Compare commits
70 Commits
Author | SHA1 | Date | |
---|---|---|---|
fd01b4d204 | |||
3a767f29be | |||
ed0885ce5c | |||
08b8d829f9 | |||
d2d3a7d52b | |||
4e032a9188 | |||
20e77196f2 | |||
45dcfc8a00 | |||
7ee0cad010 | |||
40849a5aa8 | |||
132c30e557 | |||
ee13d2382b | |||
3e1f7861a1 | |||
1aeeb1f073 | |||
0bb59bd73b | |||
a57a1d809b | |||
29a121f5b2 | |||
4cfb360d44 | |||
441796f845 | |||
3c80f0eaca | |||
86e1b792c2 | |||
decb257136 | |||
d670591713 | |||
dee2b77bdc | |||
6119312a74 | |||
b77a8af6e3 | |||
c9e9ecd699 | |||
4a0f9d8280 | |||
797b5d2311 | |||
b14d7b45ae | |||
d721a143a8 | |||
fde9c783ae | |||
c80b288db3 | |||
93898b7a5f | |||
a0a2335c16 | |||
716b41107b | |||
a9a7a89b8b | |||
4bf85a0e6b | |||
dd509333a3 | |||
8ccfbbf24c | |||
4953842ff1 | |||
8a8d97b8c7 | |||
5916fcca6a | |||
2105e4964b | |||
8ed30d1ff3 | |||
6f546efdb7 | |||
c4f62296a4 | |||
324477c1c0 | |||
160f441a95 | |||
63fdd0aec4 | |||
b3cb9c7537 | |||
8daa9c8062 | |||
9b3ee877a6 | |||
5ace37e3db | |||
2145730409 | |||
cba07d08d0 | |||
f2fea7f3cd | |||
d4a2c6cef4 | |||
51f0a5e30b | |||
25e4cebc0f | |||
5d0ded2a69 | |||
bd207b5012 | |||
38b9ed3f27 | |||
e2202b084b | |||
45b6a6bc54 | |||
d87e3a0ee3 | |||
a35b5eb279 | |||
7a270275ef | |||
f6a041559f | |||
6ea168485a |
@ -44,9 +44,9 @@ If you want to translate Misskey, please see [Translation guide](./docs/translat
|
|||||||
|
|
||||||
:mortar_board: Notable contributors
|
:mortar_board: Notable contributors
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
| ![syuilo][syuilo-icon] | ![Morisawa Aya][ayamorisawa-icon] | ![otofune][otofune-icon] | ![akihikodaki][akihikodaki-icon] | ![rinsuki][rinsuki-icon] |
|
| ![syuilo][syuilo-icon] | ![Morisawa Aya][ayamorisawa-icon] | ![otofune][otofune-icon] | ![akihikodaki][akihikodaki-icon] | ![tamaina][tamaina-icon] | ![rinsuki][rinsuki-icon] |
|
||||||
|:-:|:-:|:-:|:-:|:-:|
|
|:-:|:-:|:-:|:-:|:-:|:-:|
|
||||||
| [syuilo][syuilo-link]<br>Owner | [Aya Morisawa][ayamorisawa-link]<br>Collaborator | [otofune][otofune-link]<br>Collaborator | [akihikodaki][akihikodaki-link] | [rinsuki][rinsuki-link] |
|
| [syuilo][syuilo-link]<br>Owner | [Aya Morisawa][ayamorisawa-link]<br>Collaborator | [otofune][otofune-link]<br>Collaborator | [akihikodaki][akihikodaki-link] | [tamaina][tamaina-link] | [rinsuki][rinsuki-link] |
|
||||||
|
|
||||||
[List of all contributors](https://github.com/syuilo/misskey/graphs/contributors)
|
[List of all contributors](https://github.com/syuilo/misskey/graphs/contributors)
|
||||||
|
|
||||||
@ -92,6 +92,8 @@ Misskey is an open-source software licensed under [GNU AGPLv3](LICENSE).
|
|||||||
[akihikodaki-icon]: https://avatars2.githubusercontent.com/u/17036990?s=70&v=4
|
[akihikodaki-icon]: https://avatars2.githubusercontent.com/u/17036990?s=70&v=4
|
||||||
[rinsuki-link]: https://github.com/rinsuki
|
[rinsuki-link]: https://github.com/rinsuki
|
||||||
[rinsuki-icon]: https://avatars0.githubusercontent.com/u/6533808?s=70&v=4
|
[rinsuki-icon]: https://avatars0.githubusercontent.com/u/6533808?s=70&v=4
|
||||||
|
[tamaina-link]: https://github.com/tamaina
|
||||||
|
[tamaina-icon]: https://avatars1.githubusercontent.com/u/7973572?s=70&v=4
|
||||||
|
|
||||||
[mirro-san-link]: https://github.com/mirro-san
|
[mirro-san-link]: https://github.com/mirro-san
|
||||||
[mirro-san-icon]: https://avatars1.githubusercontent.com/u/17948612?s=70&v=4
|
[mirro-san-icon]: https://avatars1.githubusercontent.com/u/17948612?s=70&v=4
|
||||||
|
@ -140,8 +140,8 @@ inquirer.prompt(form).then(as => {
|
|||||||
pass: as['es_pass'] || null
|
pass: as['es_pass'] || null
|
||||||
},
|
},
|
||||||
recaptcha: {
|
recaptcha: {
|
||||||
siteKey: as['recaptcha_site'],
|
site_key: as['recaptcha_site'],
|
||||||
secretKey: as['recaptcha_secret']
|
secret_key: as['recaptcha_secret']
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
18
cli/suspend.js
Normal file
18
cli/suspend.js
Normal 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);
|
||||||
|
});
|
13
docs/manage.ja.md
Normal file
13
docs/manage.ja.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# 運営ガイド
|
||||||
|
|
||||||
|
## ジョブキューの状態を調べる
|
||||||
|
Misskeyのディレクトリで:
|
||||||
|
``` shell
|
||||||
|
node_modules/kue/bin/kue-dashboard -p 3050
|
||||||
|
```
|
||||||
|
ポート3050にアクセスするとUIが表示されます
|
||||||
|
|
||||||
|
## ユーザーを凍結する
|
||||||
|
``` shell
|
||||||
|
node cli/suspend (ユーザーID)
|
||||||
|
```
|
@ -98,7 +98,9 @@ common/views/components/nav.vue:
|
|||||||
feedback: "Feedback"
|
feedback: "Feedback"
|
||||||
|
|
||||||
common/views/components/note-menu.vue:
|
common/views/components/note-menu.vue:
|
||||||
|
favorite: "Favorite this note"
|
||||||
pin: "Pin to profile page"
|
pin: "Pin to profile page"
|
||||||
|
remote: "Show on origin"
|
||||||
|
|
||||||
common/views/components/poll.vue:
|
common/views/components/poll.vue:
|
||||||
vote-to: "Vote for '{}'"
|
vote-to: "Vote for '{}'"
|
||||||
@ -367,9 +369,11 @@ desktop/views/components/settings.profile.vue:
|
|||||||
desktop/views/components/ui.header.account.vue:
|
desktop/views/components/ui.header.account.vue:
|
||||||
profile: "Your profile"
|
profile: "Your profile"
|
||||||
drive: "Drive"
|
drive: "Drive"
|
||||||
|
favorites: "Favorites"
|
||||||
customize: "Customize"
|
customize: "Customize"
|
||||||
settings: "Settings"
|
settings: "Settings"
|
||||||
signout: "Sign out"
|
signout: "Sign out"
|
||||||
|
dark: "Fall in dark"
|
||||||
|
|
||||||
desktop/views/components/ui.header.nav.vue:
|
desktop/views/components/ui.header.nav.vue:
|
||||||
home: "Home"
|
home: "Home"
|
||||||
@ -406,6 +410,7 @@ desktop/views/pages/user/user.friends.vue:
|
|||||||
no-users: "No users"
|
no-users: "No users"
|
||||||
|
|
||||||
desktop/views/pages/user/user.header.vue:
|
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. "
|
is-remote: "This user is a remote user, so the information is not accurate. "
|
||||||
view-remote: "See accurate information"
|
view-remote: "See accurate information"
|
||||||
|
|
||||||
@ -594,6 +599,7 @@ mobile/views/pages/user.vue:
|
|||||||
overview: "Overview"
|
overview: "Overview"
|
||||||
timeline: "Timeline"
|
timeline: "Timeline"
|
||||||
media: "Media"
|
media: "Media"
|
||||||
|
is-suspended: "This account has been suspended."
|
||||||
is-remote: "This user is a remote user, so the information is not accurate. "
|
is-remote: "This user is a remote user, so the information is not accurate. "
|
||||||
view-remote: "See accurate information"
|
view-remote: "See accurate information"
|
||||||
|
|
||||||
|
@ -98,7 +98,9 @@ common/views/components/nav.vue:
|
|||||||
feedback: "フィードバック"
|
feedback: "フィードバック"
|
||||||
|
|
||||||
common/views/components/note-menu.vue:
|
common/views/components/note-menu.vue:
|
||||||
|
favorite: "Favorite this note"
|
||||||
pin: "Épingler sur votre profile"
|
pin: "Épingler sur votre profile"
|
||||||
|
remote: "投稿元で見る"
|
||||||
|
|
||||||
common/views/components/poll.vue:
|
common/views/components/poll.vue:
|
||||||
vote-to: "Voter pour '{}'"
|
vote-to: "Voter pour '{}'"
|
||||||
@ -367,9 +369,11 @@ desktop/views/components/settings.profile.vue:
|
|||||||
desktop/views/components/ui.header.account.vue:
|
desktop/views/components/ui.header.account.vue:
|
||||||
profile: "Votre profil"
|
profile: "Votre profil"
|
||||||
drive: "Drive"
|
drive: "Drive"
|
||||||
|
favorites: "Favorites"
|
||||||
customize: "Modifications"
|
customize: "Modifications"
|
||||||
settings: "Réglages"
|
settings: "Réglages"
|
||||||
signout: "Déconnexion"
|
signout: "Déconnexion"
|
||||||
|
dark: "Fall in dark"
|
||||||
|
|
||||||
desktop/views/components/ui.header.nav.vue:
|
desktop/views/components/ui.header.nav.vue:
|
||||||
home: "Accueil"
|
home: "Accueil"
|
||||||
@ -406,6 +410,7 @@ desktop/views/pages/user/user.friends.vue:
|
|||||||
no-users: "Pas d'utilisateurs"
|
no-users: "Pas d'utilisateurs"
|
||||||
|
|
||||||
desktop/views/pages/user/user.header.vue:
|
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 "
|
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-remote: "Voir les informations détaillées"
|
||||||
|
|
||||||
@ -594,6 +599,7 @@ mobile/views/pages/user.vue:
|
|||||||
overview: "Aperçu"
|
overview: "Aperçu"
|
||||||
timeline: "Fil d'actualité"
|
timeline: "Fil d'actualité"
|
||||||
media: "Media"
|
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 "
|
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-remote: "Voir les informations détaillées"
|
||||||
|
|
||||||
|
@ -98,7 +98,9 @@ common/views/components/nav.vue:
|
|||||||
feedback: "フィードバック"
|
feedback: "フィードバック"
|
||||||
|
|
||||||
common/views/components/note-menu.vue:
|
common/views/components/note-menu.vue:
|
||||||
|
favorite: "お気に入り"
|
||||||
pin: "ピン留め"
|
pin: "ピン留め"
|
||||||
|
remote: "投稿元で見る"
|
||||||
|
|
||||||
common/views/components/poll.vue:
|
common/views/components/poll.vue:
|
||||||
vote-to: "「{}」に投票する"
|
vote-to: "「{}」に投票する"
|
||||||
@ -367,9 +369,11 @@ desktop/views/components/settings.profile.vue:
|
|||||||
desktop/views/components/ui.header.account.vue:
|
desktop/views/components/ui.header.account.vue:
|
||||||
profile: "プロフィール"
|
profile: "プロフィール"
|
||||||
drive: "ドライブ"
|
drive: "ドライブ"
|
||||||
|
favorites: "お気に入り"
|
||||||
customize: "カスタマイズ"
|
customize: "カスタマイズ"
|
||||||
settings: "設定"
|
settings: "設定"
|
||||||
signout: "サインアウト"
|
signout: "サインアウト"
|
||||||
|
dark: "闇に飲まれる"
|
||||||
|
|
||||||
desktop/views/components/ui.header.nav.vue:
|
desktop/views/components/ui.header.nav.vue:
|
||||||
home: "ホーム"
|
home: "ホーム"
|
||||||
@ -406,7 +410,8 @@ desktop/views/pages/user/user.friends.vue:
|
|||||||
no-users: "よく話すユーザーはいません"
|
no-users: "よく話すユーザーはいません"
|
||||||
|
|
||||||
desktop/views/pages/user/user.header.vue:
|
desktop/views/pages/user/user.header.vue:
|
||||||
is-remote: "このユーザーはリモートユーザーのため情報が正確ではありません。"
|
is-suspended: "このユーザーは凍結されています。"
|
||||||
|
is-remote: "このユーザーはリモートユーザーです。"
|
||||||
view-remote: "正確な情報を見る"
|
view-remote: "正確な情報を見る"
|
||||||
|
|
||||||
desktop/views/pages/user/user.home.vue:
|
desktop/views/pages/user/user.home.vue:
|
||||||
@ -594,7 +599,8 @@ mobile/views/pages/user.vue:
|
|||||||
overview: "概要"
|
overview: "概要"
|
||||||
timeline: "タイムライン"
|
timeline: "タイムライン"
|
||||||
media: "メディア"
|
media: "メディア"
|
||||||
is-remote: "このユーザーはリモートユーザーのため情報が正確ではありません。"
|
is-suspended: "このユーザーは凍結されています。"
|
||||||
|
is-remote: "このユーザーはリモートユーザーです。"
|
||||||
view-remote: "正確な情報を見る"
|
view-remote: "正確な情報を見る"
|
||||||
|
|
||||||
mobile/views/pages/user/home.vue:
|
mobile/views/pages/user/home.vue:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "misskey",
|
"name": "misskey",
|
||||||
"author": "syuilo <i@syuilo.com>",
|
"author": "syuilo <i@syuilo.com>",
|
||||||
"version": "0.0.5018",
|
"version": "0.0.5089",
|
||||||
"codename": "nighthike",
|
"codename": "nighthike",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"description": "A miniblog-based SNS",
|
"description": "A miniblog-based SNS",
|
||||||
@ -56,6 +56,7 @@
|
|||||||
"@types/koa-bodyparser": "4.2.0",
|
"@types/koa-bodyparser": "4.2.0",
|
||||||
"@types/koa-compress": "^2.0.8",
|
"@types/koa-compress": "^2.0.8",
|
||||||
"@types/koa-favicon": "2.0.19",
|
"@types/koa-favicon": "2.0.19",
|
||||||
|
"@types/koa-logger": "^3.1.0",
|
||||||
"@types/koa-mount": "3.0.1",
|
"@types/koa-mount": "3.0.1",
|
||||||
"@types/koa-multer": "1.0.0",
|
"@types/koa-multer": "1.0.0",
|
||||||
"@types/koa-router": "7.0.27",
|
"@types/koa-router": "7.0.27",
|
||||||
@ -141,6 +142,7 @@
|
|||||||
"koa-compress": "3.0.0",
|
"koa-compress": "3.0.0",
|
||||||
"koa-favicon": "2.0.1",
|
"koa-favicon": "2.0.1",
|
||||||
"koa-json-body": "^5.3.0",
|
"koa-json-body": "^5.3.0",
|
||||||
|
"koa-logger": "^3.2.0",
|
||||||
"koa-mount": "3.0.0",
|
"koa-mount": "3.0.0",
|
||||||
"koa-multer": "1.0.2",
|
"koa-multer": "1.0.2",
|
||||||
"koa-router": "7.4.0",
|
"koa-router": "7.4.0",
|
||||||
@ -206,6 +208,7 @@
|
|||||||
"vue-router": "3.0.1",
|
"vue-router": "3.0.1",
|
||||||
"vue-template-compiler": "2.5.16",
|
"vue-template-compiler": "2.5.16",
|
||||||
"vuedraggable": "2.16.0",
|
"vuedraggable": "2.16.0",
|
||||||
|
"vuex": "^3.0.1",
|
||||||
"web-push": "3.3.0",
|
"web-push": "3.3.0",
|
||||||
"webfinger.js": "2.6.6",
|
"webfinger.js": "2.6.6",
|
||||||
"webpack": "4.6.0",
|
"webpack": "4.6.0",
|
||||||
|
@ -11,14 +11,12 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
// Chromeで確認したことなのですが、constやletを用いたとしても
|
(function() {
|
||||||
// グローバルなスコープで定数/変数を定義するとwindowのプロパティ
|
// キャッシュ削除要求があれば従う
|
||||||
// としてそれがアクセスできるようになる訳ではありませんが、普通に
|
if (localStorage.getItem('shouldFlush') == 'true') {
|
||||||
// コンソールから定数/変数名を入力するとアクセスできてしまいます。
|
refresh();
|
||||||
// ブロック内に入れてスコープを非グローバル化するとそれが防げます
|
return;
|
||||||
// (Chrome以外のブラウザでは検証していません)
|
}
|
||||||
{
|
|
||||||
if (localStorage.getItem('shouldFlush') == 'true') refresh();
|
|
||||||
|
|
||||||
// Get the current url information
|
// Get the current url information
|
||||||
const url = new URL(location.href);
|
const url = new URL(location.href);
|
||||||
@ -62,6 +60,11 @@
|
|||||||
app = isMobile ? 'mobile' : 'desktop';
|
app = isMobile ? 'mobile' : 'desktop';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Dark/Light
|
||||||
|
if (localStorage.getItem('darkmode') == 'true') {
|
||||||
|
document.documentElement.setAttribute('data-darkmode', 'true');
|
||||||
|
}
|
||||||
|
|
||||||
// Script version
|
// Script version
|
||||||
const ver = localStorage.getItem('v') || VERSION;
|
const ver = localStorage.getItem('v') || VERSION;
|
||||||
|
|
||||||
@ -72,11 +75,16 @@
|
|||||||
const raw = (localStorage.getItem('useRawScript') == 'true' && isDebug)
|
const raw = (localStorage.getItem('useRawScript') == 'true' && isDebug)
|
||||||
|| ENV != 'production';
|
|| ENV != 'production';
|
||||||
|
|
||||||
|
// Get salt query
|
||||||
|
const salt = localStorage.getItem('salt')
|
||||||
|
? '?salt=' + localStorage.getItem('salt')
|
||||||
|
: '';
|
||||||
|
|
||||||
// Load an app script
|
// Load an app script
|
||||||
// Note: 'async' make it possible to load the script asyncly.
|
// Note: 'async' make it possible to load the script asyncly.
|
||||||
// 'defer' make it possible to run the script when the dom loaded.
|
// 'defer' make it possible to run the script when the dom loaded.
|
||||||
const script = document.createElement('script');
|
const script = document.createElement('script');
|
||||||
script.setAttribute('src', `/assets/${app}.${ver}.${lang}.${raw ? 'raw' : 'min'}.js`);
|
script.setAttribute('src', `/assets/${app}.${ver}.${lang}.${raw ? 'raw' : 'min'}.js${salt}`);
|
||||||
script.setAttribute('async', 'true');
|
script.setAttribute('async', 'true');
|
||||||
script.setAttribute('defer', 'true');
|
script.setAttribute('defer', 'true');
|
||||||
head.appendChild(script);
|
head.appendChild(script);
|
||||||
@ -112,6 +120,9 @@
|
|||||||
function refresh() {
|
function refresh() {
|
||||||
localStorage.setItem('shouldFlush', 'false');
|
localStorage.setItem('shouldFlush', 'false');
|
||||||
|
|
||||||
|
// Random
|
||||||
|
localStorage.setItem('salt', Math.random().toString());
|
||||||
|
|
||||||
// Clear cache (serive worker)
|
// Clear cache (serive worker)
|
||||||
try {
|
try {
|
||||||
navigator.serviceWorker.controller.postMessage('clear');
|
navigator.serviceWorker.controller.postMessage('clear');
|
||||||
@ -126,4 +137,4 @@
|
|||||||
// Force reload
|
// Force reload
|
||||||
location.reload(true);
|
location.reload(true);
|
||||||
}
|
}
|
||||||
}
|
})();
|
||||||
|
@ -21,7 +21,9 @@ const defaultSettings = {
|
|||||||
showMaps: true,
|
showMaps: true,
|
||||||
showPostFormOnTopOfTl: false,
|
showPostFormOnTopOfTl: false,
|
||||||
gradientWindowHeader: false,
|
gradientWindowHeader: false,
|
||||||
showReplyTarget: true
|
showReplyTarget: true,
|
||||||
|
showMyRenotes: true,
|
||||||
|
showRenotedMyNotes: true
|
||||||
};
|
};
|
||||||
|
|
||||||
//#region api requests
|
//#region api requests
|
||||||
|
67
src/client/app/common/views/components/google.vue
Normal file
67
src/client/app/common/views/components/google.vue
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<template>
|
||||||
|
<div class="mk-google">
|
||||||
|
<input type="search" v-model="query" :placeholder="q">
|
||||||
|
<button @click="search">検索</button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import Vue from 'vue';
|
||||||
|
export default Vue.extend({
|
||||||
|
props: ['q'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
query: null
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.query = this.q;
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
search() {
|
||||||
|
window.open(`https://www.google.com/?#q=${this.query}`, '_blank');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="stylus" scoped>
|
||||||
|
root(isDark)
|
||||||
|
display flex
|
||||||
|
margin 8px 0
|
||||||
|
|
||||||
|
> input
|
||||||
|
flex-shrink 1
|
||||||
|
padding 10px
|
||||||
|
width 100%
|
||||||
|
height 40px
|
||||||
|
font-family sans-serif
|
||||||
|
font-size 16px
|
||||||
|
color isDark ? #dee4e8 : #55595c
|
||||||
|
background isDark ? #191b22 : #fff
|
||||||
|
border solid 1px isDark ? #495156 : #dadada
|
||||||
|
border-radius 4px 0 0 4px
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
border-color isDark ? #777c86 : #b0b0b0
|
||||||
|
|
||||||
|
> button
|
||||||
|
flex-shrink 0
|
||||||
|
padding 0 16px
|
||||||
|
border solid 1px isDark ? #495156 : #dadada
|
||||||
|
border-left none
|
||||||
|
border-radius 0 4px 4px 0
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
background-color isDark ? #2e3440 : #eee
|
||||||
|
|
||||||
|
&:active
|
||||||
|
box-shadow 0 2px 4px rgba(#000, 0.15) inset
|
||||||
|
|
||||||
|
.mk-google[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mk-google:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
|
</style>
|
@ -169,7 +169,7 @@ export default Vue.extend({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
.mk-messaging
|
root(isDark)
|
||||||
|
|
||||||
&[data-compact]
|
&[data-compact]
|
||||||
font-size 0.8em
|
font-size 0.8em
|
||||||
@ -209,7 +209,7 @@ export default Vue.extend({
|
|||||||
|
|
||||||
> .form
|
> .form
|
||||||
padding 8px
|
padding 8px
|
||||||
background #f7f7f7
|
background isDark ? #282c37 : #f7f7f7
|
||||||
|
|
||||||
> label
|
> label
|
||||||
display block
|
display block
|
||||||
@ -241,13 +241,14 @@ export default Vue.extend({
|
|||||||
line-height 38px
|
line-height 38px
|
||||||
color #000
|
color #000
|
||||||
outline none
|
outline none
|
||||||
border solid 1px #eee
|
background isDark ? #191b22 : #fff
|
||||||
|
border solid 1px isDark ? #495156 : #eee
|
||||||
border-radius 5px
|
border-radius 5px
|
||||||
box-shadow none
|
box-shadow none
|
||||||
transition color 0.5s ease, border 0.5s ease
|
transition color 0.5s ease, border 0.5s ease
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
border solid 1px #ddd
|
border solid 1px isDark ? #b0b0b0 : #ddd
|
||||||
transition border 0.2s ease
|
transition border 0.2s ease
|
||||||
|
|
||||||
&:focus
|
&:focus
|
||||||
@ -328,21 +329,21 @@ export default Vue.extend({
|
|||||||
> a
|
> a
|
||||||
display block
|
display block
|
||||||
text-decoration none
|
text-decoration none
|
||||||
background #fff
|
background isDark ? #282c37 : #fff
|
||||||
border-bottom solid 1px #eee
|
border-bottom solid 1px isDark ? #1c2023 : #eee
|
||||||
|
|
||||||
*
|
*
|
||||||
pointer-events none
|
pointer-events none
|
||||||
user-select none
|
user-select none
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
background #fafafa
|
background isDark ? #1e2129 : #fafafa
|
||||||
|
|
||||||
> .avatar
|
> .avatar
|
||||||
filter saturate(200%)
|
filter saturate(200%)
|
||||||
|
|
||||||
&:active
|
&:active
|
||||||
background #eee
|
background isDark ? #14161b : #eee
|
||||||
|
|
||||||
&[data-is-read]
|
&[data-is-read]
|
||||||
&[data-is-me]
|
&[data-is-me]
|
||||||
@ -382,17 +383,17 @@ export default Vue.extend({
|
|||||||
overflow hidden
|
overflow hidden
|
||||||
text-overflow ellipsis
|
text-overflow ellipsis
|
||||||
font-size 1em
|
font-size 1em
|
||||||
color rgba(0, 0, 0, 0.9)
|
color isDark ? #fff : rgba(0, 0, 0, 0.9)
|
||||||
font-weight bold
|
font-weight bold
|
||||||
transition all 0.1s ease
|
transition all 0.1s ease
|
||||||
|
|
||||||
> .username
|
> .username
|
||||||
margin 0 8px
|
margin 0 8px
|
||||||
color rgba(0, 0, 0, 0.5)
|
color isDark ? #606984 : rgba(0, 0, 0, 0.5)
|
||||||
|
|
||||||
> .mk-time
|
> .mk-time
|
||||||
margin 0 0 0 auto
|
margin 0 0 0 auto
|
||||||
color rgba(0, 0, 0, 0.5)
|
color isDark ? #606984 : rgba(0, 0, 0, 0.5)
|
||||||
font-size 80%
|
font-size 80%
|
||||||
|
|
||||||
> .avatar
|
> .avatar
|
||||||
@ -412,10 +413,10 @@ export default Vue.extend({
|
|||||||
overflow hidden
|
overflow hidden
|
||||||
overflow-wrap break-word
|
overflow-wrap break-word
|
||||||
font-size 1.1em
|
font-size 1.1em
|
||||||
color rgba(0, 0, 0, 0.8)
|
color isDark ? #fff : rgba(0, 0, 0, 0.8)
|
||||||
|
|
||||||
.me
|
.me
|
||||||
color rgba(0, 0, 0, 0.4)
|
color isDark ? rgba(#fff, 0.7) : rgba(0, 0, 0, 0.4)
|
||||||
|
|
||||||
> .image
|
> .image
|
||||||
display block
|
display block
|
||||||
@ -460,4 +461,10 @@ export default Vue.extend({
|
|||||||
> .avatar
|
> .avatar
|
||||||
margin 0 12px 0 0
|
margin 0 12px 0 0
|
||||||
|
|
||||||
|
.mk-messaging[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mk-messaging:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -4,6 +4,7 @@ import parse from '../../../../../text/parse';
|
|||||||
import getAcct from '../../../../../acct/render';
|
import getAcct from '../../../../../acct/render';
|
||||||
import { url } from '../../../config';
|
import { url } from '../../../config';
|
||||||
import MkUrl from './url.vue';
|
import MkUrl from './url.vue';
|
||||||
|
import MkGoogle from './google.vue';
|
||||||
|
|
||||||
const flatten = list => list.reduce(
|
const flatten = list => list.reduce(
|
||||||
(a, b) => a.concat(Array.isArray(b) ? flatten(b) : b), []
|
(a, b) => a.concat(Array.isArray(b) ? flatten(b) : b), []
|
||||||
@ -97,7 +98,9 @@ export default Vue.component('mk-note-html', {
|
|||||||
}, token.content);
|
}, token.content);
|
||||||
|
|
||||||
case 'code':
|
case 'code':
|
||||||
return createElement('pre', [
|
return createElement('pre', {
|
||||||
|
class: 'code'
|
||||||
|
}, [
|
||||||
createElement('code', {
|
createElement('code', {
|
||||||
domProps: {
|
domProps: {
|
||||||
innerHTML: token.html
|
innerHTML: token.html
|
||||||
@ -132,10 +135,24 @@ export default Vue.component('mk-note-html', {
|
|||||||
}, text2.replace(/\n/g, ' '));
|
}, text2.replace(/\n/g, ' '));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'title':
|
||||||
|
return createElement('div', {
|
||||||
|
attrs: {
|
||||||
|
class: 'title'
|
||||||
|
}
|
||||||
|
}, token.title);
|
||||||
|
|
||||||
case 'emoji':
|
case 'emoji':
|
||||||
const emoji = emojilib.lib[token.emoji];
|
const emoji = emojilib.lib[token.emoji];
|
||||||
return createElement('span', emoji ? emoji.char : token.content);
|
return createElement('span', emoji ? emoji.char : token.content);
|
||||||
|
|
||||||
|
case 'search':
|
||||||
|
return createElement(MkGoogle, {
|
||||||
|
props: {
|
||||||
|
q: token.query
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
default:
|
default:
|
||||||
console.log('unknown ast type:', token.type);
|
console.log('unknown ast type:', token.type);
|
||||||
}
|
}
|
||||||
@ -144,7 +161,7 @@ export default Vue.component('mk-note-html', {
|
|||||||
const _els = [];
|
const _els = [];
|
||||||
els.forEach((el, i) => {
|
els.forEach((el, i) => {
|
||||||
if (el.tag == 'br') {
|
if (el.tag == 'br') {
|
||||||
if (els[i - 1].tag != 'div') {
|
if (!['div', 'pre'].includes(els[i - 1].tag)) {
|
||||||
_els.push(el);
|
_els.push(el);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
<div class="mk-note-menu">
|
<div class="mk-note-menu">
|
||||||
<div class="backdrop" ref="backdrop" @click="close"></div>
|
<div class="backdrop" ref="backdrop" @click="close"></div>
|
||||||
<div class="popover" :class="{ compact }" ref="popover">
|
<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>
|
<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>
|
<a v-if="note.uri" :href="note.uri" target="_blank">%i18n:@remote%</a>
|
||||||
</div>
|
</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() {
|
close() {
|
||||||
(this.$refs.backdrop as any).style.pointerEvents = 'none';
|
(this.$refs.backdrop as any).style.pointerEvents = 'none';
|
||||||
anime({
|
anime({
|
||||||
@ -142,6 +151,7 @@ $border-color = rgba(27, 31, 35, 0.15)
|
|||||||
> a
|
> a
|
||||||
display block
|
display block
|
||||||
padding 8px 16px
|
padding 8px 16px
|
||||||
|
width 100%
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
color $theme-color-foreground
|
color $theme-color-foreground
|
||||||
|
@ -69,7 +69,7 @@ export default Vue.extend({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
.mk-poll-editor
|
root(isDark)
|
||||||
padding 8px
|
padding 8px
|
||||||
|
|
||||||
> .caution
|
> .caution
|
||||||
@ -102,6 +102,8 @@ export default Vue.extend({
|
|||||||
padding 6px 8px
|
padding 6px 8px
|
||||||
width 300px
|
width 300px
|
||||||
font-size 14px
|
font-size 14px
|
||||||
|
color isDark ? #fff : #000
|
||||||
|
background isDark ? #191b22 : #fff
|
||||||
border solid 1px rgba($theme-color, 0.1)
|
border solid 1px rgba($theme-color, 0.1)
|
||||||
border-radius 4px
|
border-radius 4px
|
||||||
|
|
||||||
@ -139,4 +141,10 @@ export default Vue.extend({
|
|||||||
&:active
|
&:active
|
||||||
color darken($theme-color, 30%)
|
color darken($theme-color, 30%)
|
||||||
|
|
||||||
|
.mk-poll-editor[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mk-poll-editor:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -68,7 +68,7 @@ export default Vue.extend({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
.mk-poll
|
root(isDark)
|
||||||
|
|
||||||
> ul
|
> ul
|
||||||
display block
|
display block
|
||||||
@ -81,7 +81,8 @@ export default Vue.extend({
|
|||||||
margin 4px 0
|
margin 4px 0
|
||||||
padding 4px 8px
|
padding 4px 8px
|
||||||
width 100%
|
width 100%
|
||||||
border solid 1px #eee
|
color isDark ? #fff : #000
|
||||||
|
border solid 1px isDark ? #5e636f : #eee
|
||||||
border-radius 4px
|
border-radius 4px
|
||||||
overflow hidden
|
overflow hidden
|
||||||
cursor pointer
|
cursor pointer
|
||||||
@ -108,6 +109,8 @@ export default Vue.extend({
|
|||||||
margin-left 4px
|
margin-left 4px
|
||||||
|
|
||||||
> p
|
> p
|
||||||
|
color isDark ? #a3aebf : #000
|
||||||
|
|
||||||
a
|
a
|
||||||
color inherit
|
color inherit
|
||||||
|
|
||||||
@ -121,4 +124,10 @@ export default Vue.extend({
|
|||||||
&:active
|
&:active
|
||||||
background transparent
|
background transparent
|
||||||
|
|
||||||
|
.mk-poll[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mk-poll:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -110,7 +110,7 @@ export default Vue.extend({
|
|||||||
|
|
||||||
$border-color = rgba(27, 31, 35, 0.15)
|
$border-color = rgba(27, 31, 35, 0.15)
|
||||||
|
|
||||||
.mk-reaction-picker
|
root(isDark)
|
||||||
position initial
|
position initial
|
||||||
|
|
||||||
> .backdrop
|
> .backdrop
|
||||||
@ -124,9 +124,10 @@ $border-color = rgba(27, 31, 35, 0.15)
|
|||||||
opacity 0
|
opacity 0
|
||||||
|
|
||||||
> .popover
|
> .popover
|
||||||
|
$bgcolor = isDark ? #2c303c : #fff
|
||||||
position absolute
|
position absolute
|
||||||
z-index 10001
|
z-index 10001
|
||||||
background #fff
|
background $bgcolor
|
||||||
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)
|
||||||
@ -159,15 +160,15 @@ $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 $bgcolor
|
||||||
|
|
||||||
> p
|
> p
|
||||||
display block
|
display block
|
||||||
margin 0
|
margin 0
|
||||||
padding 8px 10px
|
padding 8px 10px
|
||||||
font-size 14px
|
font-size 14px
|
||||||
color #586069
|
color isDark ? #d6dce2 : #586069
|
||||||
border-bottom solid 1px #e1e4e8
|
border-bottom solid 1px isDark ? #1c2023 : #e1e4e8
|
||||||
|
|
||||||
> div
|
> div
|
||||||
padding 4px
|
padding 4px
|
||||||
@ -182,10 +183,16 @@ $border-color = rgba(27, 31, 35, 0.15)
|
|||||||
border-radius 2px
|
border-radius 2px
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
background #eee
|
background isDark ? #252731 : #eee
|
||||||
|
|
||||||
&:active
|
&:active
|
||||||
background $theme-color
|
background $theme-color
|
||||||
box-shadow inset 0 0.15em 0.3em rgba(27, 31, 35, 0.15)
|
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>
|
</style>
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mk-reactions-viewer">
|
<div class="mk-reactions-viewer">
|
||||||
<template v-if="reactions">
|
<template v-if="reactions">
|
||||||
<span v-if="reactions.like"><mk-reaction-icon reaction='like'/><span>{{ reactions.like }}</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.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.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.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.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.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.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.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.pudding"><mk-reaction-icon reaction="pudding"/><span>{{ reactions.pudding }}</span></span>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -27,9 +27,10 @@ export default Vue.extend({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.mk-reactions-viewer
|
root(isDark)
|
||||||
border-top dashed 1px #eee
|
$borderColor = isDark ? #5e6673 : #eee
|
||||||
border-bottom dashed 1px #eee
|
border-top dashed 1px $borderColor
|
||||||
|
border-bottom dashed 1px $borderColor
|
||||||
margin 4px 0
|
margin 4px 0
|
||||||
|
|
||||||
&:empty
|
&:empty
|
||||||
@ -44,6 +45,12 @@ export default Vue.extend({
|
|||||||
> span
|
> span
|
||||||
margin-left 4px
|
margin-left 4px
|
||||||
font-size 1.2em
|
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>
|
</style>
|
||||||
|
@ -87,7 +87,7 @@ export default Vue.extend({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
.mk-switch
|
root(isDark)
|
||||||
display flex
|
display flex
|
||||||
margin 12px 0
|
margin 12px 0
|
||||||
cursor pointer
|
cursor pointer
|
||||||
@ -121,11 +121,12 @@ export default Vue.extend({
|
|||||||
&:hover
|
&:hover
|
||||||
> .label
|
> .label
|
||||||
> span
|
> span
|
||||||
color #2e3338
|
color isDark ? #fff : #2e3338
|
||||||
|
|
||||||
> .button
|
> .button
|
||||||
background #ced2da
|
$color = isDark ? #15181d : #ced2da
|
||||||
border-color #ced2da
|
background $color
|
||||||
|
border-color $color
|
||||||
|
|
||||||
> input
|
> input
|
||||||
position absolute
|
position absolute
|
||||||
@ -147,14 +148,16 @@ export default Vue.extend({
|
|||||||
border-radius 14px
|
border-radius 14px
|
||||||
|
|
||||||
> .button
|
> .button
|
||||||
|
$color = isDark ? #1c1f25 : #dcdfe6
|
||||||
|
|
||||||
display inline-block
|
display inline-block
|
||||||
margin 0
|
margin 0
|
||||||
width 40px
|
width 40px
|
||||||
min-width 40px
|
min-width 40px
|
||||||
height 20px
|
height 20px
|
||||||
min-height 20px
|
min-height 20px
|
||||||
background #dcdfe6
|
background $color
|
||||||
border 1px solid #dcdfe6
|
border 1px solid $color
|
||||||
outline none
|
outline none
|
||||||
border-radius 10px
|
border-radius 10px
|
||||||
transition inherit
|
transition inherit
|
||||||
@ -179,12 +182,18 @@ export default Vue.extend({
|
|||||||
> span
|
> span
|
||||||
display block
|
display block
|
||||||
line-height 20px
|
line-height 20px
|
||||||
color #4a535a
|
color isDark ? #c4ccd2 : #4a535a
|
||||||
transition inherit
|
transition inherit
|
||||||
|
|
||||||
> p
|
> p
|
||||||
margin 0
|
margin 0
|
||||||
//font-size 90%
|
//font-size 90%
|
||||||
color #9daab3
|
color isDark ? #78858e : #9daab3
|
||||||
|
|
||||||
|
.mk-switch[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mk-switch:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -50,8 +50,6 @@ export default Vue.extend({
|
|||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.mk-twitter-setting
|
.mk-twitter-setting
|
||||||
color #4a535a
|
|
||||||
|
|
||||||
.account
|
.account
|
||||||
border solid 1px #e1e8ed
|
border solid 1px #e1e8ed
|
||||||
border-radius 4px
|
border-radius 4px
|
||||||
|
@ -65,16 +65,16 @@ export default Vue.extend({
|
|||||||
iframe
|
iframe
|
||||||
width 100%
|
width 100%
|
||||||
|
|
||||||
.mk-url-preview
|
root(isDark)
|
||||||
display block
|
display block
|
||||||
font-size 16px
|
font-size 16px
|
||||||
border solid 1px #eee
|
border solid 1px isDark ? #191b1f : #eee
|
||||||
border-radius 4px
|
border-radius 4px
|
||||||
overflow hidden
|
overflow hidden
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
text-decoration none
|
text-decoration none
|
||||||
border-color #ddd
|
border-color isDark ? #4f5561 : #ddd
|
||||||
|
|
||||||
> article > header > h1
|
> article > header > h1
|
||||||
text-decoration underline
|
text-decoration underline
|
||||||
@ -99,11 +99,11 @@ iframe
|
|||||||
> h1
|
> h1
|
||||||
margin 0
|
margin 0
|
||||||
font-size 1em
|
font-size 1em
|
||||||
color #555
|
color isDark ? #d6dae0 : #555
|
||||||
|
|
||||||
> p
|
> p
|
||||||
margin 0
|
margin 0
|
||||||
color #777
|
color isDark ? #a4aab3 : #777
|
||||||
font-size 0.8em
|
font-size 0.8em
|
||||||
|
|
||||||
> footer
|
> footer
|
||||||
@ -120,7 +120,7 @@ iframe
|
|||||||
> p
|
> p
|
||||||
display inline-block
|
display inline-block
|
||||||
margin 0
|
margin 0
|
||||||
color #666
|
color isDark ? #b0b4bf : #666
|
||||||
font-size 0.8em
|
font-size 0.8em
|
||||||
line-height 16px
|
line-height 16px
|
||||||
vertical-align top
|
vertical-align top
|
||||||
@ -139,4 +139,10 @@ iframe
|
|||||||
> article
|
> article
|
||||||
padding 8px
|
padding 8px
|
||||||
|
|
||||||
|
.mk-url-preview[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mk-url-preview:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -109,10 +109,10 @@ export default define({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
.mkw-calendar
|
root(isDark)
|
||||||
padding 16px 0
|
padding 16px 0
|
||||||
color #777
|
color isDark ? #c5ced6 :#777
|
||||||
background #fff
|
background isDark ? #282C37 : #fff
|
||||||
border solid 1px rgba(0, 0, 0, 0.075)
|
border solid 1px rgba(0, 0, 0, 0.075)
|
||||||
border-radius 6px
|
border-radius 6px
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ export default define({
|
|||||||
margin 0 0 2px 0
|
margin 0 0 2px 0
|
||||||
font-size 12px
|
font-size 12px
|
||||||
line-height 18px
|
line-height 18px
|
||||||
color #888
|
color isDark ? #7a8692 : #888
|
||||||
|
|
||||||
> b
|
> b
|
||||||
margin-left 2px
|
margin-left 2px
|
||||||
@ -179,7 +179,7 @@ export default define({
|
|||||||
> .meter
|
> .meter
|
||||||
width 100%
|
width 100%
|
||||||
overflow hidden
|
overflow hidden
|
||||||
background #eee
|
background isDark ? #1c1f25 : #eee
|
||||||
border-radius 8px
|
border-radius 8px
|
||||||
|
|
||||||
> .val
|
> .val
|
||||||
@ -198,4 +198,10 @@ export default define({
|
|||||||
> .meter > .val
|
> .meter > .val
|
||||||
background #41ddde
|
background #41ddde
|
||||||
|
|
||||||
|
.mkw-calendar[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mkw-calendar:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -19,9 +19,9 @@ export default define({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.mkw-donation
|
root(isDark)
|
||||||
background #fff
|
background isDark ? #282c37 : #fff
|
||||||
border solid 1px #ead8bb
|
border solid 1px isDark ? #c3831c : #ead8bb
|
||||||
border-radius 6px
|
border-radius 6px
|
||||||
|
|
||||||
> article
|
> article
|
||||||
@ -30,7 +30,7 @@ export default define({
|
|||||||
> h1
|
> h1
|
||||||
margin 0 0 5px 0
|
margin 0 0 5px 0
|
||||||
font-size 1em
|
font-size 1em
|
||||||
color #888
|
color isDark ? #b2bac1 : #888
|
||||||
|
|
||||||
> [data-fa]
|
> [data-fa]
|
||||||
margin-right 0.25em
|
margin-right 0.25em
|
||||||
@ -40,7 +40,7 @@ export default define({
|
|||||||
z-index 1
|
z-index 1
|
||||||
margin 0
|
margin 0
|
||||||
font-size 0.8em
|
font-size 0.8em
|
||||||
color #999
|
color isDark ? #a1a6ab : #999
|
||||||
|
|
||||||
&[data-mobile]
|
&[data-mobile]
|
||||||
border none
|
border none
|
||||||
@ -55,4 +55,10 @@ export default define({
|
|||||||
> p
|
> p
|
||||||
color #777d71
|
color #777d71
|
||||||
|
|
||||||
|
.mkw-donation[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mkw-donation:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mkw-nav">
|
<div class="mkw-nav">
|
||||||
<mk-widget-container>
|
<mk-widget-container>
|
||||||
<div :class="$style.body">
|
<div class="mkw-nav--body">
|
||||||
<mk-nav/>
|
<mk-nav/>
|
||||||
</div>
|
</div>
|
||||||
</mk-widget-container>
|
</mk-widget-container>
|
||||||
@ -15,17 +15,24 @@ export default define({
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" module>
|
<style lang="stylus" scoped>
|
||||||
.body
|
root(isDark)
|
||||||
padding 16px
|
.mkw-nav--body
|
||||||
font-size 12px
|
padding 16px
|
||||||
color #aaa
|
font-size 12px
|
||||||
background #fff
|
color isDark ? #9aa4b3 : #aaa
|
||||||
|
background isDark ? #282c37 : #fff
|
||||||
|
|
||||||
a
|
a
|
||||||
color #999
|
color isDark ? #9aa4b3 : #999
|
||||||
|
|
||||||
i
|
i
|
||||||
color #ccc
|
color isDark ? #9aa4b3 : #ccc
|
||||||
|
|
||||||
|
.mkw-nav[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mkw-nav:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -4,9 +4,11 @@
|
|||||||
<template slot="header">%fa:rss-square%RSS</template>
|
<template slot="header">%fa:rss-square%RSS</template>
|
||||||
<button slot="func" title="設定" @click="setting">%fa:cog%</button>
|
<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="mkw-rss--body">
|
||||||
<div :class="$style.feed" v-else>
|
<p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
|
||||||
<a v-for="item in items" :href="item.link" target="_blank">{{ item.title }}</a>
|
<div class="feed" v-else>
|
||||||
|
<a v-for="item in items" :href="item.link" target="_blank">{{ item.title }}</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</mk-widget-container>
|
</mk-widget-container>
|
||||||
</div>
|
</div>
|
||||||
@ -56,38 +58,46 @@ export default define({
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" module>
|
<style lang="stylus" scoped>
|
||||||
.feed
|
root(isDark)
|
||||||
padding 12px 16px
|
.mkw-rss--body
|
||||||
font-size 0.9em
|
.feed
|
||||||
|
padding 12px 16px
|
||||||
|
font-size 0.9em
|
||||||
|
|
||||||
> a
|
> a
|
||||||
display block
|
display block
|
||||||
padding 4px 0
|
padding 4px 0
|
||||||
color #666
|
color isDark ? #9aa4b3 : #666
|
||||||
border-bottom dashed 1px #eee
|
border-bottom dashed 1px isDark ? #1c2023 : #eee
|
||||||
|
|
||||||
&:last-child
|
&:last-child
|
||||||
border-bottom none
|
border-bottom none
|
||||||
|
|
||||||
.fetching
|
.fetching
|
||||||
margin 0
|
margin 0
|
||||||
padding 16px
|
padding 16px
|
||||||
text-align center
|
text-align center
|
||||||
color #aaa
|
color #aaa
|
||||||
|
|
||||||
> [data-fa]
|
> [data-fa]
|
||||||
margin-right 4px
|
margin-right 4px
|
||||||
|
|
||||||
&[data-mobile]
|
&[data-mobile]
|
||||||
.feed
|
.feed
|
||||||
padding 0
|
padding 0
|
||||||
font-size 1em
|
font-size 1em
|
||||||
|
|
||||||
> a
|
> a
|
||||||
padding 8px 16px
|
padding 8px 16px
|
||||||
|
|
||||||
&:nth-child(even)
|
&:nth-child(even)
|
||||||
background rgba(0, 0, 0, 0.05)
|
background rgba(0, 0, 0, 0.05)
|
||||||
|
|
||||||
|
.mkw-rss[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mkw-rss:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -100,7 +100,7 @@ export default Vue.extend({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.cpu-memory
|
root(isDark)
|
||||||
> svg
|
> svg
|
||||||
display block
|
display block
|
||||||
padding 10px
|
padding 10px
|
||||||
@ -115,7 +115,7 @@ export default Vue.extend({
|
|||||||
|
|
||||||
> text
|
> text
|
||||||
font-size 5px
|
font-size 5px
|
||||||
fill rgba(0, 0, 0, 0.55)
|
fill isDark ? rgba(#fff, 0.55) : rgba(#000, 0.55)
|
||||||
|
|
||||||
> tspan
|
> tspan
|
||||||
opacity 0.5
|
opacity 0.5
|
||||||
@ -124,4 +124,11 @@ export default Vue.extend({
|
|||||||
content ""
|
content ""
|
||||||
display block
|
display block
|
||||||
clear both
|
clear both
|
||||||
|
|
||||||
|
.cpu-memory[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.cpu-memory:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -38,7 +38,7 @@ export default Vue.extend({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.cpu
|
root(isDark)
|
||||||
> .pie
|
> .pie
|
||||||
padding 10px
|
padding 10px
|
||||||
height 100px
|
height 100px
|
||||||
@ -52,7 +52,7 @@ export default Vue.extend({
|
|||||||
> p
|
> p
|
||||||
margin 0
|
margin 0
|
||||||
font-size 12px
|
font-size 12px
|
||||||
color #505050
|
color isDark ? #a8b4bd : #505050
|
||||||
|
|
||||||
&:first-child
|
&:first-child
|
||||||
font-weight bold
|
font-weight bold
|
||||||
@ -65,4 +65,10 @@ export default Vue.extend({
|
|||||||
display block
|
display block
|
||||||
clear both
|
clear both
|
||||||
|
|
||||||
|
.cpu[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.cpu:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -46,7 +46,7 @@ export default Vue.extend({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.disk
|
root(isDark)
|
||||||
> .pie
|
> .pie
|
||||||
padding 10px
|
padding 10px
|
||||||
height 100px
|
height 100px
|
||||||
@ -60,7 +60,7 @@ export default Vue.extend({
|
|||||||
> p
|
> p
|
||||||
margin 0
|
margin 0
|
||||||
font-size 12px
|
font-size 12px
|
||||||
color #505050
|
color isDark ? #a8b4bd : #505050
|
||||||
|
|
||||||
&:first-child
|
&:first-child
|
||||||
font-weight bold
|
font-weight bold
|
||||||
@ -73,4 +73,10 @@ export default Vue.extend({
|
|||||||
display block
|
display block
|
||||||
clear both
|
clear both
|
||||||
|
|
||||||
|
.disk[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.disk:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -46,7 +46,7 @@ export default Vue.extend({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.memory
|
root(isDark)
|
||||||
> .pie
|
> .pie
|
||||||
padding 10px
|
padding 10px
|
||||||
height 100px
|
height 100px
|
||||||
@ -60,7 +60,7 @@ export default Vue.extend({
|
|||||||
> p
|
> p
|
||||||
margin 0
|
margin 0
|
||||||
font-size 12px
|
font-size 12px
|
||||||
color #505050
|
color isDark ? #a8b4bd : #505050
|
||||||
|
|
||||||
&:first-child
|
&:first-child
|
||||||
font-weight bold
|
font-weight bold
|
||||||
@ -73,4 +73,10 @@ export default Vue.extend({
|
|||||||
display block
|
display block
|
||||||
clear both
|
clear both
|
||||||
|
|
||||||
|
.memory[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.memory:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -45,7 +45,7 @@ export default Vue.extend({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
svg
|
root(isDark)
|
||||||
display block
|
display block
|
||||||
height 100%
|
height 100%
|
||||||
|
|
||||||
@ -56,6 +56,12 @@ svg
|
|||||||
|
|
||||||
> text
|
> text
|
||||||
font-size 0.15px
|
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>
|
</style>
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
* Desktop Client
|
* Desktop Client
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import Vue from 'vue';
|
||||||
import VueRouter from 'vue-router';
|
import VueRouter from 'vue-router';
|
||||||
|
|
||||||
// Style
|
// Style
|
||||||
@ -24,6 +25,7 @@ import updateBanner from './api/update-banner';
|
|||||||
|
|
||||||
import MkIndex from './views/pages/index.vue';
|
import MkIndex from './views/pages/index.vue';
|
||||||
import MkUser from './views/pages/user/user.vue';
|
import MkUser from './views/pages/user/user.vue';
|
||||||
|
import MkFavorites from './views/pages/favorites.vue';
|
||||||
import MkSelectDrive from './views/pages/selectdrive.vue';
|
import MkSelectDrive from './views/pages/selectdrive.vue';
|
||||||
import MkDrive from './views/pages/drive.vue';
|
import MkDrive from './views/pages/drive.vue';
|
||||||
import MkHomeCustomize from './views/pages/home-customize.vue';
|
import MkHomeCustomize from './views/pages/home-customize.vue';
|
||||||
@ -49,6 +51,7 @@ init(async (launch) => {
|
|||||||
routes: [
|
routes: [
|
||||||
{ path: '/', name: 'index', component: MkIndex },
|
{ path: '/', name: 'index', component: MkIndex },
|
||||||
{ path: '/i/customize-home', component: MkHomeCustomize },
|
{ path: '/i/customize-home', component: MkHomeCustomize },
|
||||||
|
{ path: '/i/favorites', component: MkFavorites },
|
||||||
{ path: '/i/messaging/:user', component: MkMessagingRoom },
|
{ path: '/i/messaging/:user', component: MkMessagingRoom },
|
||||||
{ path: '/i/drive', component: MkDrive },
|
{ path: '/i/drive', component: MkDrive },
|
||||||
{ path: '/i/drive/folder/:folder', component: MkDrive },
|
{ path: '/i/drive/folder/:folder', component: MkDrive },
|
||||||
|
@ -44,6 +44,26 @@ html
|
|||||||
height 100%
|
height 100%
|
||||||
background #f7f7f7
|
background #f7f7f7
|
||||||
|
|
||||||
|
&[data-darkmode]
|
||||||
|
background #191B22
|
||||||
|
|
||||||
|
&, *
|
||||||
|
&::-webkit-scrollbar-track
|
||||||
|
background-color #282C37
|
||||||
|
|
||||||
|
&::-webkit-scrollbar
|
||||||
|
width 6px
|
||||||
|
height 6px
|
||||||
|
|
||||||
|
&::-webkit-scrollbar-thumb
|
||||||
|
background-color #454954
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
background-color #535660
|
||||||
|
|
||||||
|
&:active
|
||||||
|
background-color $theme-color
|
||||||
|
|
||||||
body
|
body
|
||||||
display flex
|
display flex
|
||||||
flex-direction column
|
flex-direction column
|
||||||
|
@ -123,3 +123,59 @@ textarea.ui
|
|||||||
font-size 90%
|
font-size 90%
|
||||||
font-weight bold
|
font-weight bold
|
||||||
color rgba(#373a3c, 0.9)
|
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
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mk-activity" :data-melt="design == 2">
|
<div class="mk-activity">
|
||||||
<template v-if="design == 0">
|
<mk-widget-container :show-header="design == 0" :naked="design == 2">
|
||||||
<p class="title">%fa:chart-bar%%i18n:@title%</p>
|
<template slot="header">%fa:chart-bar%%i18n:@title%</template>
|
||||||
<button @click="toggle" title="%i18n:@toggle%">%fa:sort%</button>
|
<button slot="func" title="%i18n:@toggle%" @click="toggle">%fa:sort%</button>
|
||||||
</template>
|
|
||||||
<p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
|
<p :class="$style.fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<x-calendar v-show="view == 0" :data="[].concat(activity)"/>
|
<x-calendar v-show="view == 0" :data="[].concat(activity)"/>
|
||||||
<x-chart v-show="view == 1" :data="[].concat(activity)"/>
|
<x-chart v-show="view == 1" :data="[].concat(activity)"/>
|
||||||
</template>
|
</template>
|
||||||
|
</mk-widget-container>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -64,53 +65,14 @@ export default Vue.extend({
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" module>
|
||||||
.mk-activity
|
.fetching
|
||||||
background #fff
|
margin 0
|
||||||
border solid 1px rgba(0, 0, 0, 0.075)
|
padding 16px
|
||||||
border-radius 6px
|
text-align center
|
||||||
|
color #aaa
|
||||||
|
|
||||||
&[data-melt]
|
> [data-fa]
|
||||||
background transparent !important
|
margin-right 4px
|
||||||
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
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -133,9 +133,9 @@ export default Vue.extend({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
.mk-calendar
|
root(isDark)
|
||||||
color #777
|
color isDark ? #c5ced6 : #777
|
||||||
background #fff
|
background isDark ? #282C37 : #fff
|
||||||
border solid 1px rgba(0, 0, 0, 0.075)
|
border solid 1px rgba(0, 0, 0, 0.075)
|
||||||
border-radius 6px
|
border-radius 6px
|
||||||
|
|
||||||
@ -249,4 +249,10 @@ export default Vue.extend({
|
|||||||
&:active > div
|
&:active > div
|
||||||
background darken($theme-color, 10%)
|
background darken($theme-color, 10%)
|
||||||
|
|
||||||
|
.mk-calendar[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mk-calendar:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -31,7 +31,7 @@ export default Vue.extend({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
.menu
|
root(isDark)
|
||||||
$width = 240px
|
$width = 240px
|
||||||
$item-height = 38px
|
$item-height = 38px
|
||||||
$padding = 10px
|
$padding = 10px
|
||||||
@ -46,7 +46,7 @@ export default Vue.extend({
|
|||||||
&.divider
|
&.divider
|
||||||
margin-top $padding
|
margin-top $padding
|
||||||
padding-top $padding
|
padding-top $padding
|
||||||
border-top solid 1px #eee
|
border-top solid 1px isDark ? #1c2023 : #eee
|
||||||
|
|
||||||
&.nest
|
&.nest
|
||||||
> p
|
> p
|
||||||
@ -75,7 +75,7 @@ export default Vue.extend({
|
|||||||
margin 0
|
margin 0
|
||||||
padding 0 32px 0 38px
|
padding 0 32px 0 38px
|
||||||
line-height $item-height
|
line-height $item-height
|
||||||
color #868C8C
|
color isDark ? #c8cece : #868C8C
|
||||||
text-decoration none
|
text-decoration none
|
||||||
cursor pointer
|
cursor pointer
|
||||||
|
|
||||||
@ -104,11 +104,17 @@ export default Vue.extend({
|
|||||||
left $width
|
left $width
|
||||||
margin-top -($padding)
|
margin-top -($padding)
|
||||||
width $width
|
width $width
|
||||||
background #fff
|
background isDark ? #282c37 :#fff
|
||||||
border-radius 0 4px 4px 4px
|
border-radius 0 4px 4px 4px
|
||||||
box-shadow 2px 2px 8px rgba(0, 0, 0, 0.2)
|
box-shadow 2px 2px 8px rgba(0, 0, 0, 0.2)
|
||||||
transition visibility 0s linear 0.2s
|
transition visibility 0s linear 0.2s
|
||||||
|
|
||||||
|
.menu[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.menu:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style lang="stylus" module>
|
<style lang="stylus" module>
|
||||||
|
@ -54,7 +54,7 @@ export default Vue.extend({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.context-menu
|
root(isDark)
|
||||||
$width = 240px
|
$width = 240px
|
||||||
$item-height = 38px
|
$item-height = 38px
|
||||||
$padding = 10px
|
$padding = 10px
|
||||||
@ -66,9 +66,15 @@ export default Vue.extend({
|
|||||||
z-index 4096
|
z-index 4096
|
||||||
width $width
|
width $width
|
||||||
font-size 0.8em
|
font-size 0.8em
|
||||||
background #fff
|
background isDark ? #282c37 : #fff
|
||||||
border-radius 0 4px 4px 4px
|
border-radius 0 4px 4px 4px
|
||||||
box-shadow 2px 2px 8px rgba(0, 0, 0, 0.2)
|
box-shadow 2px 2px 8px rgba(0, 0, 0, 0.2)
|
||||||
opacity 0
|
opacity 0
|
||||||
|
|
||||||
|
.context-menu[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.context-menu:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -186,7 +186,7 @@ export default Vue.extend({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
.root.file
|
root(isDark)
|
||||||
padding 8px 0 0 0
|
padding 8px 0 0 0
|
||||||
height 180px
|
height 180px
|
||||||
border-radius 4px
|
border-radius 4px
|
||||||
@ -308,10 +308,16 @@ export default Vue.extend({
|
|||||||
font-size 0.8em
|
font-size 0.8em
|
||||||
text-align center
|
text-align center
|
||||||
word-break break-all
|
word-break break-all
|
||||||
color #444
|
color isDark ? #fff : #444
|
||||||
overflow hidden
|
overflow hidden
|
||||||
|
|
||||||
> .ext
|
> .ext
|
||||||
opacity 0.5
|
opacity 0.5
|
||||||
|
|
||||||
|
.root.file[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.root.file:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -577,7 +577,7 @@ export default Vue.extend({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
.mk-drive
|
root(isDark)
|
||||||
|
|
||||||
> nav
|
> nav
|
||||||
display block
|
display block
|
||||||
@ -585,9 +585,8 @@ export default Vue.extend({
|
|||||||
width 100%
|
width 100%
|
||||||
overflow auto
|
overflow auto
|
||||||
font-size 0.9em
|
font-size 0.9em
|
||||||
color #555
|
color isDark ? #d2d9dc : #555
|
||||||
background #fff
|
background isDark ? #282c37 : #fff
|
||||||
//border-bottom 1px solid #dfdfdf
|
|
||||||
box-shadow 0 1px 0 rgba(0, 0, 0, 0.05)
|
box-shadow 0 1px 0 rgba(0, 0, 0, 0.05)
|
||||||
|
|
||||||
&, *
|
&, *
|
||||||
@ -665,6 +664,7 @@ export default Vue.extend({
|
|||||||
padding 8px
|
padding 8px
|
||||||
height calc(100% - 38px)
|
height calc(100% - 38px)
|
||||||
overflow auto
|
overflow auto
|
||||||
|
background isDark ? #191b22 : #fff
|
||||||
|
|
||||||
&, *
|
&, *
|
||||||
user-select none
|
user-select none
|
||||||
@ -770,4 +770,10 @@ export default Vue.extend({
|
|||||||
> input
|
> input
|
||||||
display none
|
display none
|
||||||
|
|
||||||
|
.mk-drive[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mk-drive:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -94,7 +94,7 @@ export default Vue.extend({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
.mk-follow-button
|
root(isDark)
|
||||||
display block
|
display block
|
||||||
cursor pointer
|
cursor pointer
|
||||||
padding 0
|
padding 0
|
||||||
@ -121,17 +121,17 @@ export default Vue.extend({
|
|||||||
border-radius 8px
|
border-radius 8px
|
||||||
|
|
||||||
&.follow
|
&.follow
|
||||||
color #888
|
color isDark ? #fff : #888
|
||||||
background linear-gradient(to bottom, #ffffff 0%, #f5f5f5 100%)
|
background isDark ? linear-gradient(to bottom, #313543 0%, #282c37 100%) : linear-gradient(to bottom, #ffffff 0%, #f5f5f5 100%)
|
||||||
border solid 1px #e2e2e2
|
border solid 1px isDark ? #1c2023 : #e2e2e2
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
background linear-gradient(to bottom, #f9f9f9 0%, #ececec 100%)
|
background isDark ? linear-gradient(to bottom, #2c2f3c 0%, #22262f 100%) : linear-gradient(to bottom, #f9f9f9 0%, #ececec 100%)
|
||||||
border-color #dcdcdc
|
border-color isDark ? #151a1d : #dcdcdc
|
||||||
|
|
||||||
&:active
|
&:active
|
||||||
background #ececec
|
background isDark ? #22262f : #ececec
|
||||||
border-color #dcdcdc
|
border-color isDark ? #151a1d : #dcdcdc
|
||||||
|
|
||||||
&.unfollow
|
&.unfollow
|
||||||
color $theme-color-foreground
|
color $theme-color-foreground
|
||||||
@ -161,4 +161,10 @@ export default Vue.extend({
|
|||||||
i
|
i
|
||||||
margin-right 8px
|
margin-right 8px
|
||||||
|
|
||||||
|
.mk-follow-button[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mk-follow-button:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -219,7 +219,7 @@ export default Vue.extend({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
.mk-home
|
root(isDark)
|
||||||
display block
|
display block
|
||||||
|
|
||||||
&[data-customize]
|
&[data-customize]
|
||||||
@ -249,7 +249,8 @@ export default Vue.extend({
|
|||||||
left 0
|
left 0
|
||||||
width 100%
|
width 100%
|
||||||
height 48px
|
height 48px
|
||||||
background #f7f7f7
|
color isDark ? #fff : #000
|
||||||
|
background isDark ? #313543 : #f7f7f7
|
||||||
box-shadow 0 1px 1px rgba(0, 0, 0, 0.075)
|
box-shadow 0 1px 1px rgba(0, 0, 0, 0.075)
|
||||||
|
|
||||||
> a
|
> a
|
||||||
@ -289,7 +290,7 @@ export default Vue.extend({
|
|||||||
line-height 48px
|
line-height 48px
|
||||||
|
|
||||||
&.trash
|
&.trash
|
||||||
border-left solid 1px #ddd
|
border-left solid 1px isDark ? #1c2023 : #ddd
|
||||||
|
|
||||||
> div
|
> div
|
||||||
width 100%
|
width 100%
|
||||||
@ -329,7 +330,7 @@ export default Vue.extend({
|
|||||||
|
|
||||||
.mk-post-form
|
.mk-post-form
|
||||||
margin-bottom 16px
|
margin-bottom 16px
|
||||||
border solid 1px #e5e5e5
|
border solid 1px rgba(#000, 0.075)
|
||||||
border-radius 4px
|
border-radius 4px
|
||||||
|
|
||||||
> *:not(.main)
|
> *:not(.main)
|
||||||
@ -357,4 +358,10 @@ export default Vue.extend({
|
|||||||
max-width 700px
|
max-width 700px
|
||||||
margin 0 auto
|
margin 0 auto
|
||||||
|
|
||||||
|
.mk-home[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mk-home:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -31,7 +31,7 @@ export default Vue.extend({
|
|||||||
const xp = mouseX / this.$el.offsetWidth * 100;
|
const xp = mouseX / this.$el.offsetWidth * 100;
|
||||||
const yp = mouseY / this.$el.offsetHeight * 100;
|
const yp = mouseY / this.$el.offsetHeight * 100;
|
||||||
this.$el.style.backgroundPosition = xp + '% ' + yp + '%';
|
this.$el.style.backgroundPosition = xp + '% ' + yp + '%';
|
||||||
this.$el.style.backgroundImage = 'url("' + this.image.url + '?thumbnail")';
|
this.$el.style.backgroundImage = `url("${this.image.url}")`;
|
||||||
},
|
},
|
||||||
|
|
||||||
onMouseleave() {
|
onMouseleave() {
|
||||||
|
@ -33,19 +33,14 @@ export default Vue.extend({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.mk-note-preview
|
root(isDark)
|
||||||
font-size 0.9em
|
font-size 0.9em
|
||||||
background #fff
|
|
||||||
|
|
||||||
&:after
|
&:after
|
||||||
content ""
|
content ""
|
||||||
display block
|
display block
|
||||||
clear both
|
clear both
|
||||||
|
|
||||||
&:hover
|
|
||||||
> .main > footer > button
|
|
||||||
color #888
|
|
||||||
|
|
||||||
> .avatar-anchor
|
> .avatar-anchor
|
||||||
display block
|
display block
|
||||||
float left
|
float left
|
||||||
@ -70,7 +65,7 @@ export default Vue.extend({
|
|||||||
> .name
|
> .name
|
||||||
margin 0 .5em 0 0
|
margin 0 .5em 0 0
|
||||||
padding 0
|
padding 0
|
||||||
color #607073
|
color isDark ? #fff : #607073
|
||||||
font-size 1em
|
font-size 1em
|
||||||
font-weight bold
|
font-weight bold
|
||||||
text-decoration none
|
text-decoration none
|
||||||
@ -81,11 +76,11 @@ export default Vue.extend({
|
|||||||
|
|
||||||
> .username
|
> .username
|
||||||
margin 0 .5em 0 0
|
margin 0 .5em 0 0
|
||||||
color #d1d8da
|
color isDark ? #606984 : #d1d8da
|
||||||
|
|
||||||
> .time
|
> .time
|
||||||
margin-left auto
|
margin-left auto
|
||||||
color #b2b8bb
|
color isDark ? #606984 : #b2b8bb
|
||||||
|
|
||||||
> .body
|
> .body
|
||||||
|
|
||||||
@ -94,6 +89,12 @@ export default Vue.extend({
|
|||||||
margin 0
|
margin 0
|
||||||
padding 0
|
padding 0
|
||||||
font-size 1.1em
|
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>
|
</style>
|
||||||
|
@ -33,7 +33,7 @@ export default Vue.extend({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.sub
|
root(isDark)
|
||||||
margin 0
|
margin 0
|
||||||
padding 16px
|
padding 16px
|
||||||
font-size 0.9em
|
font-size 0.9em
|
||||||
@ -43,10 +43,6 @@ export default Vue.extend({
|
|||||||
display block
|
display block
|
||||||
clear both
|
clear both
|
||||||
|
|
||||||
&:hover
|
|
||||||
> .main > footer > button
|
|
||||||
color #888
|
|
||||||
|
|
||||||
> .avatar-anchor
|
> .avatar-anchor
|
||||||
display block
|
display block
|
||||||
float left
|
float left
|
||||||
@ -75,7 +71,7 @@ export default Vue.extend({
|
|||||||
margin 0 .5em 0 0
|
margin 0 .5em 0 0
|
||||||
padding 0
|
padding 0
|
||||||
overflow hidden
|
overflow hidden
|
||||||
color #607073
|
color isDark ? #fff : #607073
|
||||||
font-size 1em
|
font-size 1em
|
||||||
font-weight bold
|
font-weight bold
|
||||||
text-decoration none
|
text-decoration none
|
||||||
@ -86,23 +82,31 @@ export default Vue.extend({
|
|||||||
|
|
||||||
> .username
|
> .username
|
||||||
margin 0 .5em 0 0
|
margin 0 .5em 0 0
|
||||||
color #d1d8da
|
color isDark ? #606984 : #d1d8da
|
||||||
|
|
||||||
> .created-at
|
> .created-at
|
||||||
margin-left auto
|
margin-left auto
|
||||||
color #b2b8bb
|
color isDark ? #606984 : #b2b8bb
|
||||||
|
|
||||||
> .body
|
> .body
|
||||||
|
max-height 128px
|
||||||
|
overflow hidden
|
||||||
|
|
||||||
> .text
|
> .text
|
||||||
cursor default
|
cursor default
|
||||||
margin 0
|
margin 0
|
||||||
padding 0
|
padding 0
|
||||||
font-size 1.1em
|
font-size 1.1em
|
||||||
color #717171
|
color isDark ? #959ba7 : #717171
|
||||||
|
|
||||||
pre
|
pre
|
||||||
max-height 120px
|
max-height 120px
|
||||||
font-size 80%
|
font-size 80%
|
||||||
|
|
||||||
|
.sub[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.sub:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -4,15 +4,13 @@
|
|||||||
<x-sub :note="p.reply"/>
|
<x-sub :note="p.reply"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="renote" v-if="isRenote">
|
<div class="renote" v-if="isRenote">
|
||||||
<p>
|
<router-link class="avatar-anchor" :to="note.user | userPage" v-user-preview="note.userId">
|
||||||
<router-link class="avatar-anchor" :to="note.user | userPage" v-user-preview="note.userId">
|
<img class="avatar" :src="`${note.user.avatarUrl}?thumbnail&size=32`" alt="avatar"/>
|
||||||
<img class="avatar" :src="`${note.user.avatarUrl}?thumbnail&size=32`" alt="avatar"/>
|
</router-link>
|
||||||
</router-link>
|
%fa:retweet%
|
||||||
%fa:retweet%
|
<span>{{ '%i18n:!@reposted-by%'.substr(0, '%i18n:!@reposted-by%'.indexOf('{')) }}</span>
|
||||||
<span>{{ '%i18n:!@reposted-by%'.substr(0, '%i18n:!@reposted-by%'.indexOf('{')) }}</span>
|
<a class="name" :href="note.user | userPage" v-user-preview="note.userId">{{ note.user | userName }}</a>
|
||||||
<a class="name" :href="note.user | userPage" v-user-preview="note.userId">{{ note.user | userName }}</a>
|
<span>{{ '%i18n:!@reposted-by%'.substr('%i18n:!@reposted-by%'.indexOf('}') + 1) }}</span>
|
||||||
<span>{{ '%i18n:!@reposted-by%'.substr('%i18n:!@reposted-by%'.indexOf('}') + 1) }}</span>
|
|
||||||
</p>
|
|
||||||
<mk-time :time="note.createdAt"/>
|
<mk-time :time="note.createdAt"/>
|
||||||
</div>
|
</div>
|
||||||
<article>
|
<article>
|
||||||
@ -36,24 +34,30 @@
|
|||||||
<p class="channel" v-if="p.channel">
|
<p class="channel" v-if="p.channel">
|
||||||
<a :href="`${_CH_URL_}/${p.channel.id}`" target="_blank">{{ p.channel.title }}</a>:
|
<a :href="`${_CH_URL_}/${p.channel.id}`" target="_blank">{{ p.channel.title }}</a>:
|
||||||
</p>
|
</p>
|
||||||
<div class="text">
|
<p v-if="p.cw != null" class="cw">
|
||||||
<a class="reply" v-if="p.reply">%fa:reply%</a>
|
<span class="text" v-if="p.cw != ''">{{ p.cw }}</span>
|
||||||
<mk-note-html v-if="p.textHtml" :text="p.text" :i="os.i" :class="$style.text"/>
|
<span class="toggle" @click="showContent = !showContent">{{ showContent ? '隠す' : 'もっと見る' }}</span>
|
||||||
<a class="rp" v-if="p.renote">RP:</a>
|
</p>
|
||||||
|
<div class="content" v-show="p.cw == null || showContent">
|
||||||
|
<div class="text">
|
||||||
|
<a class="reply" v-if="p.reply">%fa:reply%</a>
|
||||||
|
<mk-note-html v-if="p.text" :text="p.text" :i="os.i" :class="$style.text"/>
|
||||||
|
<a class="rp" v-if="p.renote">RP:</a>
|
||||||
|
</div>
|
||||||
|
<div class="media" v-if="p.media.length > 0">
|
||||||
|
<mk-media-list :media-list="p.media"/>
|
||||||
|
</div>
|
||||||
|
<mk-poll v-if="p.poll" :note="p" ref="pollViewer"/>
|
||||||
|
<div class="tags" v-if="p.tags && p.tags.length > 0">
|
||||||
|
<router-link v-for="tag in p.tags" :key="tag" :to="`/search?q=#${tag}`">{{ tag }}</router-link>
|
||||||
|
</div>
|
||||||
|
<a class="location" v-if="p.geo" :href="`http://maps.google.com/maps?q=${p.geo.coordinates[1]},${p.geo.coordinates[0]}`" target="_blank">%fa:map-marker-alt% 位置情報</a>
|
||||||
|
<div class="map" v-if="p.geo" ref="map"></div>
|
||||||
|
<div class="renote" v-if="p.renote">
|
||||||
|
<mk-note-preview :note="p.renote"/>
|
||||||
|
</div>
|
||||||
|
<mk-url-preview v-for="url in urls" :url="url" :key="url"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="media" v-if="p.media.length > 0">
|
|
||||||
<mk-media-list :media-list="p.media"/>
|
|
||||||
</div>
|
|
||||||
<mk-poll v-if="p.poll" :note="p" ref="pollViewer"/>
|
|
||||||
<div class="tags" v-if="p.tags && p.tags.length > 0">
|
|
||||||
<router-link v-for="tag in p.tags" :key="tag" :to="`/search?q=#${tag}`">{{ tag }}</router-link>
|
|
||||||
</div>
|
|
||||||
<a class="location" v-if="p.geo" :href="`http://maps.google.com/maps?q=${p.geo.coordinates[1]},${p.geo.coordinates[0]}`" target="_blank">%fa:map-marker-alt% 位置情報</a>
|
|
||||||
<div class="map" v-if="p.geo" ref="map"></div>
|
|
||||||
<div class="renote" v-if="p.renote">
|
|
||||||
<mk-note-preview :note="p.renote"/>
|
|
||||||
</div>
|
|
||||||
<mk-url-preview v-for="url in urls" :url="url" :key="url"/>
|
|
||||||
</div>
|
</div>
|
||||||
<footer>
|
<footer>
|
||||||
<mk-reactions-viewer :note="p" ref="reactionsViewer"/>
|
<mk-reactions-viewer :note="p" ref="reactionsViewer"/>
|
||||||
@ -115,6 +119,7 @@ export default Vue.extend({
|
|||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
showContent: false,
|
||||||
isDetailOpened: false,
|
isDetailOpened: false,
|
||||||
connection: null,
|
connection: null,
|
||||||
connectionId: null
|
connectionId: null
|
||||||
@ -291,20 +296,21 @@ export default Vue.extend({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
.note
|
root(isDark)
|
||||||
margin 0
|
margin 0
|
||||||
padding 0
|
padding 0
|
||||||
background #fff
|
background isDark ? #282C37 : #fff
|
||||||
border-bottom solid 1px #eaeaea
|
border-bottom solid 1px isDark ? #1c2023 : #eaeaea
|
||||||
|
|
||||||
&:first-child
|
&[data-round]
|
||||||
border-top-left-radius 6px
|
&:first-child
|
||||||
border-top-right-radius 6px
|
|
||||||
|
|
||||||
> .renote
|
|
||||||
border-top-left-radius 6px
|
border-top-left-radius 6px
|
||||||
border-top-right-radius 6px
|
border-top-right-radius 6px
|
||||||
|
|
||||||
|
> .renote
|
||||||
|
border-top-left-radius 6px
|
||||||
|
border-top-right-radius 6px
|
||||||
|
|
||||||
&:last-of-type
|
&:last-of-type
|
||||||
border-bottom none
|
border-bottom none
|
||||||
|
|
||||||
@ -323,36 +329,44 @@ export default Vue.extend({
|
|||||||
border-radius 4px
|
border-radius 4px
|
||||||
|
|
||||||
> .renote
|
> .renote
|
||||||
|
display flex
|
||||||
|
align-items baseline
|
||||||
|
padding 16px 32px
|
||||||
|
line-height 28px
|
||||||
color #9dbb00
|
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
|
.avatar-anchor
|
||||||
margin 0
|
display inline-block
|
||||||
padding 16px 32px
|
|
||||||
line-height 28px
|
|
||||||
|
|
||||||
.avatar-anchor
|
.avatar
|
||||||
display inline-block
|
vertical-align bottom
|
||||||
|
width 28px
|
||||||
|
height 28px
|
||||||
|
margin 0 8px 0 0
|
||||||
|
border-radius 6px
|
||||||
|
|
||||||
.avatar
|
[data-fa]
|
||||||
vertical-align bottom
|
margin-right 4px
|
||||||
width 28px
|
|
||||||
height 28px
|
|
||||||
margin 0 8px 0 0
|
|
||||||
border-radius 6px
|
|
||||||
|
|
||||||
[data-fa]
|
> span
|
||||||
margin-right 4px
|
flex-shrink 0
|
||||||
|
|
||||||
.name
|
&:last-of-type
|
||||||
font-weight bold
|
margin-right 8px
|
||||||
|
|
||||||
|
.name
|
||||||
|
overflow hidden
|
||||||
|
flex-shrink 1
|
||||||
|
text-overflow ellipsis
|
||||||
|
white-space nowrap
|
||||||
|
font-weight bold
|
||||||
|
|
||||||
> .mk-time
|
> .mk-time
|
||||||
position absolute
|
display block
|
||||||
top 16px
|
margin-left auto
|
||||||
right 32px
|
flex-shrink 0
|
||||||
font-size 0.9em
|
font-size 0.9em
|
||||||
line-height 28px
|
|
||||||
|
|
||||||
& + article
|
& + article
|
||||||
padding-top 8px
|
padding-top 8px
|
||||||
@ -374,7 +388,7 @@ export default Vue.extend({
|
|||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
> .main > footer > button
|
> .main > footer > button
|
||||||
color #888
|
color isDark ? #707b97 : #888
|
||||||
|
|
||||||
> .avatar-anchor
|
> .avatar-anchor
|
||||||
display block
|
display block
|
||||||
@ -407,7 +421,7 @@ export default Vue.extend({
|
|||||||
margin 0 .5em 0 0
|
margin 0 .5em 0 0
|
||||||
padding 0
|
padding 0
|
||||||
overflow hidden
|
overflow hidden
|
||||||
color #627079
|
color isDark ? #fff : #627079
|
||||||
font-size 1em
|
font-size 1em
|
||||||
font-weight bold
|
font-weight bold
|
||||||
text-decoration none
|
text-decoration none
|
||||||
@ -420,13 +434,15 @@ export default Vue.extend({
|
|||||||
margin 0 .5em 0 0
|
margin 0 .5em 0 0
|
||||||
padding 1px 6px
|
padding 1px 6px
|
||||||
font-size 12px
|
font-size 12px
|
||||||
color #aaa
|
color isDark ? #758188 :#aaa
|
||||||
border solid 1px #ddd
|
border solid 1px isDark ? #57616f : #ddd
|
||||||
border-radius 3px
|
border-radius 3px
|
||||||
|
|
||||||
> .username
|
> .username
|
||||||
margin 0 .5em 0 0
|
margin 0 .5em 0 0
|
||||||
color #ccc
|
overflow hidden
|
||||||
|
text-overflow ellipsis
|
||||||
|
color isDark ? #606984 : #ccc
|
||||||
|
|
||||||
> .info
|
> .info
|
||||||
margin-left auto
|
margin-left auto
|
||||||
@ -434,7 +450,7 @@ export default Vue.extend({
|
|||||||
|
|
||||||
> .mobile
|
> .mobile
|
||||||
margin-right 8px
|
margin-right 8px
|
||||||
color #ccc
|
color isDark ? #606984 : #ccc
|
||||||
|
|
||||||
> .app
|
> .app
|
||||||
margin-right 8px
|
margin-right 8px
|
||||||
@ -443,91 +459,130 @@ export default Vue.extend({
|
|||||||
border-right solid 1px #eaeaea
|
border-right solid 1px #eaeaea
|
||||||
|
|
||||||
> .created-at
|
> .created-at
|
||||||
color #c0c0c0
|
color isDark ? #606984 : #c0c0c0
|
||||||
|
|
||||||
> .body
|
> .body
|
||||||
|
|
||||||
> .text
|
> .cw
|
||||||
cursor default
|
cursor default
|
||||||
display block
|
display block
|
||||||
margin 0
|
margin 0
|
||||||
padding 0
|
padding 0
|
||||||
overflow-wrap break-word
|
overflow-wrap break-word
|
||||||
font-size 1.1em
|
font-size 1.1em
|
||||||
color #717171
|
color isDark ? #fff : #717171
|
||||||
|
|
||||||
>>> .quote
|
> .text
|
||||||
margin 8px
|
|
||||||
padding 6px 12px
|
|
||||||
color #aaa
|
|
||||||
border-left solid 3px #eee
|
|
||||||
|
|
||||||
> .reply
|
|
||||||
margin-right 8px
|
margin-right 8px
|
||||||
color #717171
|
|
||||||
|
|
||||||
> .rp
|
> .toggle
|
||||||
margin-left 4px
|
|
||||||
font-style oblique
|
|
||||||
color #a0bf46
|
|
||||||
|
|
||||||
> .location
|
|
||||||
margin 4px 0
|
|
||||||
font-size 12px
|
|
||||||
color #ccc
|
|
||||||
|
|
||||||
> .map
|
|
||||||
width 100%
|
|
||||||
height 300px
|
|
||||||
|
|
||||||
&:empty
|
|
||||||
display none
|
|
||||||
|
|
||||||
> .tags
|
|
||||||
margin 4px 0 0 0
|
|
||||||
|
|
||||||
> *
|
|
||||||
display inline-block
|
display inline-block
|
||||||
margin 0 8px 0 0
|
padding 4px 8px
|
||||||
padding 2px 8px 2px 16px
|
font-size 0.7em
|
||||||
font-size 90%
|
color isDark ? #393f4f : #fff
|
||||||
color #8d969e
|
background isDark ? #687390 : #b1b9c1
|
||||||
background #edf0f3
|
border-radius 2px
|
||||||
border-radius 4px
|
cursor pointer
|
||||||
|
user-select none
|
||||||
&:before
|
|
||||||
content ""
|
|
||||||
display block
|
|
||||||
position absolute
|
|
||||||
top 0
|
|
||||||
bottom 0
|
|
||||||
left 4px
|
|
||||||
width 8px
|
|
||||||
height 8px
|
|
||||||
margin auto 0
|
|
||||||
background #fff
|
|
||||||
border-radius 100%
|
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
text-decoration none
|
background isDark ? #707b97 : #bbc4ce
|
||||||
background #e2e7ec
|
|
||||||
|
|
||||||
.mk-url-preview
|
> .content
|
||||||
margin-top 8px
|
|
||||||
|
|
||||||
> .channel
|
> .text
|
||||||
margin 0
|
cursor default
|
||||||
|
display block
|
||||||
|
margin 0
|
||||||
|
padding 0
|
||||||
|
overflow-wrap break-word
|
||||||
|
font-size 1.1em
|
||||||
|
color isDark ? #fff : #717171
|
||||||
|
|
||||||
> .mk-poll
|
>>> .title
|
||||||
font-size 80%
|
display block
|
||||||
|
margin-bottom 4px
|
||||||
|
padding 4px
|
||||||
|
font-size 90%
|
||||||
|
text-align center
|
||||||
|
background isDark ? #2f3944 : #eef1f3
|
||||||
|
border-radius 4px
|
||||||
|
|
||||||
> .renote
|
>>> .code
|
||||||
margin 8px 0
|
margin 8px 0
|
||||||
|
|
||||||
> .mk-note-preview
|
>>> .quote
|
||||||
padding 16px
|
margin 8px
|
||||||
border dashed 1px #c0dac6
|
padding 6px 12px
|
||||||
border-radius 8px
|
color isDark ? #6f808e : #aaa
|
||||||
|
border-left solid 3px isDark ? #637182 : #eee
|
||||||
|
|
||||||
|
> .reply
|
||||||
|
margin-right 8px
|
||||||
|
color isDark ? #99abbf : #717171
|
||||||
|
|
||||||
|
> .rp
|
||||||
|
margin-left 4px
|
||||||
|
font-style oblique
|
||||||
|
color #a0bf46
|
||||||
|
|
||||||
|
> .location
|
||||||
|
margin 4px 0
|
||||||
|
font-size 12px
|
||||||
|
color #ccc
|
||||||
|
|
||||||
|
> .map
|
||||||
|
width 100%
|
||||||
|
height 300px
|
||||||
|
|
||||||
|
&:empty
|
||||||
|
display none
|
||||||
|
|
||||||
|
> .tags
|
||||||
|
margin 4px 0 0 0
|
||||||
|
|
||||||
|
> *
|
||||||
|
display inline-block
|
||||||
|
margin 0 8px 0 0
|
||||||
|
padding 2px 8px 2px 16px
|
||||||
|
font-size 90%
|
||||||
|
color #8d969e
|
||||||
|
background #edf0f3
|
||||||
|
border-radius 4px
|
||||||
|
|
||||||
|
&:before
|
||||||
|
content ""
|
||||||
|
display block
|
||||||
|
position absolute
|
||||||
|
top 0
|
||||||
|
bottom 0
|
||||||
|
left 4px
|
||||||
|
width 8px
|
||||||
|
height 8px
|
||||||
|
margin auto 0
|
||||||
|
background #fff
|
||||||
|
border-radius 100%
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
text-decoration none
|
||||||
|
background #e2e7ec
|
||||||
|
|
||||||
|
.mk-url-preview
|
||||||
|
margin-top 8px
|
||||||
|
|
||||||
|
> .channel
|
||||||
|
margin 0
|
||||||
|
|
||||||
|
> .mk-poll
|
||||||
|
font-size 80%
|
||||||
|
|
||||||
|
> .renote
|
||||||
|
margin 8px 0
|
||||||
|
|
||||||
|
> .mk-note-preview
|
||||||
|
padding 16px
|
||||||
|
border dashed 1px isDark ? #4e945e : #c0dac6
|
||||||
|
border-radius 8px
|
||||||
|
|
||||||
> footer
|
> footer
|
||||||
> button
|
> button
|
||||||
@ -535,13 +590,13 @@ export default Vue.extend({
|
|||||||
padding 0 8px
|
padding 0 8px
|
||||||
line-height 32px
|
line-height 32px
|
||||||
font-size 1em
|
font-size 1em
|
||||||
color #ddd
|
color isDark ? #606984 : #ddd
|
||||||
background transparent
|
background transparent
|
||||||
border none
|
border none
|
||||||
cursor pointer
|
cursor pointer
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
color #666
|
color isDark ? #9198af : #666
|
||||||
|
|
||||||
> .count
|
> .count
|
||||||
display inline
|
display inline
|
||||||
@ -560,6 +615,12 @@ export default Vue.extend({
|
|||||||
padding-top 4px
|
padding-top 4px
|
||||||
background rgba(0, 0, 0, 0.0125)
|
background rgba(0, 0, 0, 0.0125)
|
||||||
|
|
||||||
|
.note[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.note:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style lang="stylus" module>
|
<style lang="stylus" module>
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mk-notes">
|
<div class="mk-notes">
|
||||||
<template v-for="(note, i) in _notes">
|
<transition-group name="mk-notes" class="transition">
|
||||||
<x-note :note="note" :key="note.id" @update:note="onNoteUpdated(i, $event)"/>
|
<template v-for="(note, i) in _notes">
|
||||||
<p class="date" v-if="i != notes.length - 1 && note._date != _notes[i + 1]._date">
|
<x-note :note="note" :key="note.id" @update:note="onNoteUpdated(i, $event)"/>
|
||||||
<span>%fa:angle-up%{{ note._datetext }}</span>
|
<p class="date" :key="note.id + '_date'" v-if="i != notes.length - 1 && note._date != _notes[i + 1]._date">
|
||||||
<span>%fa:angle-down%{{ _notes[i + 1]._datetext }}</span>
|
<span>%fa:angle-up%{{ note._datetext }}</span>
|
||||||
</p>
|
<span>%fa:angle-down%{{ _notes[i + 1]._datetext }}</span>
|
||||||
</template>
|
</p>
|
||||||
|
</template>
|
||||||
|
</transition-group>
|
||||||
<footer>
|
<footer>
|
||||||
<slot name="footer"></slot>
|
<slot name="footer"></slot>
|
||||||
</footer>
|
</footer>
|
||||||
@ -50,23 +52,31 @@ export default Vue.extend({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.mk-notes
|
root(isDark)
|
||||||
|
.transition
|
||||||
|
.mk-notes-enter
|
||||||
|
.mk-notes-leave-to
|
||||||
|
opacity 0
|
||||||
|
transform translateY(-30px)
|
||||||
|
|
||||||
> .date
|
> *
|
||||||
display block
|
transition transform .3s ease, opacity .3s ease
|
||||||
margin 0
|
|
||||||
line-height 32px
|
|
||||||
font-size 14px
|
|
||||||
text-align center
|
|
||||||
color #aaa
|
|
||||||
background #fdfdfd
|
|
||||||
border-bottom solid 1px #eaeaea
|
|
||||||
|
|
||||||
span
|
> .date
|
||||||
margin 0 16px
|
display block
|
||||||
|
margin 0
|
||||||
|
line-height 32px
|
||||||
|
font-size 14px
|
||||||
|
text-align center
|
||||||
|
color isDark ? #666b79 : #aaa
|
||||||
|
background isDark ? #242731 : #fdfdfd
|
||||||
|
border-bottom solid 1px isDark ? #1c2023 : #eaeaea
|
||||||
|
|
||||||
[data-fa]
|
span
|
||||||
margin-right 8px
|
margin 0 16px
|
||||||
|
|
||||||
|
[data-fa]
|
||||||
|
margin-right 8px
|
||||||
|
|
||||||
> footer
|
> footer
|
||||||
> *
|
> *
|
||||||
@ -86,4 +96,11 @@ export default Vue.extend({
|
|||||||
|
|
||||||
&:active
|
&:active
|
||||||
background #eee
|
background #eee
|
||||||
|
|
||||||
|
.mk-notes[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mk-notes:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,96 +1,98 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mk-notifications">
|
<div class="mk-notifications">
|
||||||
<div class="notifications" v-if="notifications.length != 0">
|
<div class="notifications" v-if="notifications.length != 0">
|
||||||
<template v-for="(notification, i) in _notifications">
|
<transition-group name="mk-notifications" class="transition">
|
||||||
<div class="notification" :class="notification.type" :key="notification.id">
|
<template v-for="(notification, i) in _notifications">
|
||||||
<mk-time :time="notification.createdAt"/>
|
<div class="notification" :class="notification.type" :key="notification.id">
|
||||||
<template v-if="notification.type == 'reaction'">
|
<mk-time :time="notification.createdAt"/>
|
||||||
<router-link class="avatar-anchor" :to="notification.user | userPage" v-user-preview="notification.user.id">
|
<template v-if="notification.type == 'reaction'">
|
||||||
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
|
<router-link class="avatar-anchor" :to="notification.user | userPage" v-user-preview="notification.user.id">
|
||||||
</router-link>
|
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
|
||||||
<div class="text">
|
|
||||||
<p>
|
|
||||||
<mk-reaction-icon :reaction="notification.reaction"/>
|
|
||||||
<router-link :to="notification.user | userPage" v-user-preview="notification.user.id">{{ notification.user | userName }}</router-link>
|
|
||||||
</p>
|
|
||||||
<router-link class="note-ref" :to="notification.note | notePage">
|
|
||||||
%fa:quote-left%{{ getNoteSummary(notification.note) }}%fa:quote-right%
|
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
<div class="text">
|
||||||
</template>
|
<p>
|
||||||
<template v-if="notification.type == 'renote'">
|
<mk-reaction-icon :reaction="notification.reaction"/>
|
||||||
<router-link class="avatar-anchor" :to="notification.note.user | userPage" v-user-preview="notification.note.userId">
|
<router-link :to="notification.user | userPage" v-user-preview="notification.user.id">{{ notification.user | userName }}</router-link>
|
||||||
<img class="avatar" :src="`${notification.note.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
|
</p>
|
||||||
</router-link>
|
<router-link class="note-ref" :to="notification.note | notePage">
|
||||||
<div class="text">
|
%fa:quote-left%{{ getNoteSummary(notification.note) }}%fa:quote-right%
|
||||||
<p>%fa:retweet%
|
</router-link>
|
||||||
<router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId">{{ notification.note.user | userName }}</router-link>
|
</div>
|
||||||
</p>
|
</template>
|
||||||
<router-link class="note-ref" :to="notification.note | notePage">
|
<template v-if="notification.type == 'renote'">
|
||||||
%fa:quote-left%{{ getNoteSummary(notification.note.renote) }}%fa:quote-right%
|
<router-link class="avatar-anchor" :to="notification.note.user | userPage" v-user-preview="notification.note.userId">
|
||||||
|
<img class="avatar" :src="`${notification.note.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
<div class="text">
|
||||||
</template>
|
<p>%fa:retweet%
|
||||||
<template v-if="notification.type == 'quote'">
|
<router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId">{{ notification.note.user | userName }}</router-link>
|
||||||
<router-link class="avatar-anchor" :to="notification.note.user | userPage" v-user-preview="notification.note.userId">
|
</p>
|
||||||
<img class="avatar" :src="`${notification.note.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
|
<router-link class="note-ref" :to="notification.note | notePage">
|
||||||
</router-link>
|
%fa:quote-left%{{ getNoteSummary(notification.note.renote) }}%fa:quote-right%
|
||||||
<div class="text">
|
</router-link>
|
||||||
<p>%fa:quote-left%
|
</div>
|
||||||
<router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId">{{ notification.note.user | userName }}</router-link>
|
</template>
|
||||||
</p>
|
<template v-if="notification.type == 'quote'">
|
||||||
<router-link class="note-preview" :to="notification.note | notePage">{{ getNoteSummary(notification.note) }}</router-link>
|
<router-link class="avatar-anchor" :to="notification.note.user | userPage" v-user-preview="notification.note.userId">
|
||||||
</div>
|
<img class="avatar" :src="`${notification.note.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
|
||||||
</template>
|
|
||||||
<template v-if="notification.type == 'follow'">
|
|
||||||
<router-link class="avatar-anchor" :to="notification.user | userPage" v-user-preview="notification.user.id">
|
|
||||||
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
|
|
||||||
</router-link>
|
|
||||||
<div class="text">
|
|
||||||
<p>%fa:user-plus%
|
|
||||||
<router-link :to="notification.user | userPage" v-user-preview="notification.user.id">{{ notification.user | userName }}</router-link>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<template v-if="notification.type == 'reply'">
|
|
||||||
<router-link class="avatar-anchor" :to="notification.note.user | userPage" v-user-preview="notification.note.userId">
|
|
||||||
<img class="avatar" :src="`${notification.note.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
|
|
||||||
</router-link>
|
|
||||||
<div class="text">
|
|
||||||
<p>%fa:reply%
|
|
||||||
<router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId">{{ notification.note.user | userName }}</router-link>
|
|
||||||
</p>
|
|
||||||
<router-link class="note-preview" :to="notification.note | notePage">{{ getNoteSummary(notification.note) }}</router-link>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<template v-if="notification.type == 'mention'">
|
|
||||||
<router-link class="avatar-anchor" :to="notification.note.user | userPage" v-user-preview="notification.note.userId">
|
|
||||||
<img class="avatar" :src="`${notification.note.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
|
|
||||||
</router-link>
|
|
||||||
<div class="text">
|
|
||||||
<p>%fa:at%
|
|
||||||
<router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId">{{ notification.note.user | userName }}</router-link>
|
|
||||||
</p>
|
|
||||||
<a class="note-preview" :href="notification.note | notePage">{{ getNoteSummary(notification.note) }}</a>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<template v-if="notification.type == 'poll_vote'">
|
|
||||||
<router-link class="avatar-anchor" :to="notification.user | userPage" v-user-preview="notification.user.id">
|
|
||||||
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
|
|
||||||
</router-link>
|
|
||||||
<div class="text">
|
|
||||||
<p>%fa:chart-pie%<a :href="notification.user | userPage" v-user-preview="notification.user.id">{{ notification.user | userName }}</a></p>
|
|
||||||
<router-link class="note-ref" :to="notification.note | notePage">
|
|
||||||
%fa:quote-left%{{ getNoteSummary(notification.note) }}%fa:quote-right%
|
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
<div class="text">
|
||||||
</template>
|
<p>%fa:quote-left%
|
||||||
</div>
|
<router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId">{{ notification.note.user | userName }}</router-link>
|
||||||
<p class="date" v-if="i != notifications.length - 1 && notification._date != _notifications[i + 1]._date" :key="notification.id + '-time'">
|
</p>
|
||||||
<span>%fa:angle-up%{{ notification._datetext }}</span>
|
<router-link class="note-preview" :to="notification.note | notePage">{{ getNoteSummary(notification.note) }}</router-link>
|
||||||
<span>%fa:angle-down%{{ _notifications[i + 1]._datetext }}</span>
|
</div>
|
||||||
</p>
|
</template>
|
||||||
</template>
|
<template v-if="notification.type == 'follow'">
|
||||||
|
<router-link class="avatar-anchor" :to="notification.user | userPage" v-user-preview="notification.user.id">
|
||||||
|
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
|
||||||
|
</router-link>
|
||||||
|
<div class="text">
|
||||||
|
<p>%fa:user-plus%
|
||||||
|
<router-link :to="notification.user | userPage" v-user-preview="notification.user.id">{{ notification.user | userName }}</router-link>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-if="notification.type == 'reply'">
|
||||||
|
<router-link class="avatar-anchor" :to="notification.note.user | userPage" v-user-preview="notification.note.userId">
|
||||||
|
<img class="avatar" :src="`${notification.note.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
|
||||||
|
</router-link>
|
||||||
|
<div class="text">
|
||||||
|
<p>%fa:reply%
|
||||||
|
<router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId">{{ notification.note.user | userName }}</router-link>
|
||||||
|
</p>
|
||||||
|
<router-link class="note-preview" :to="notification.note | notePage">{{ getNoteSummary(notification.note) }}</router-link>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-if="notification.type == 'mention'">
|
||||||
|
<router-link class="avatar-anchor" :to="notification.note.user | userPage" v-user-preview="notification.note.userId">
|
||||||
|
<img class="avatar" :src="`${notification.note.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
|
||||||
|
</router-link>
|
||||||
|
<div class="text">
|
||||||
|
<p>%fa:at%
|
||||||
|
<router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId">{{ notification.note.user | userName }}</router-link>
|
||||||
|
</p>
|
||||||
|
<a class="note-preview" :href="notification.note | notePage">{{ getNoteSummary(notification.note) }}</a>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-if="notification.type == 'poll_vote'">
|
||||||
|
<router-link class="avatar-anchor" :to="notification.user | userPage" v-user-preview="notification.user.id">
|
||||||
|
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
|
||||||
|
</router-link>
|
||||||
|
<div class="text">
|
||||||
|
<p>%fa:chart-pie%<a :href="notification.user | userPage" v-user-preview="notification.user.id">{{ notification.user | userName }}</a></p>
|
||||||
|
<router-link class="note-ref" :to="notification.note | notePage">
|
||||||
|
%fa:quote-left%{{ getNoteSummary(notification.note) }}%fa:quote-right%
|
||||||
|
</router-link>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
<p class="date" v-if="i != notifications.length - 1 && notification._date != _notifications[i + 1]._date" :key="notification.id + '-time'">
|
||||||
|
<span>%fa:angle-up%{{ notification._datetext }}</span>
|
||||||
|
<span>%fa:angle-down%{{ _notifications[i + 1]._datetext }}</span>
|
||||||
|
</p>
|
||||||
|
</template>
|
||||||
|
</transition-group>
|
||||||
</div>
|
</div>
|
||||||
<button class="more" :class="{ fetching: fetchingMoreNotifications }" v-if="moreNotifications" @click="fetchMoreNotifications" :disabled="fetchingMoreNotifications">
|
<button class="more" :class="{ fetching: fetchingMoreNotifications }" v-if="moreNotifications" @click="fetchMoreNotifications" :disabled="fetchingMoreNotifications">
|
||||||
<template v-if="fetchingMoreNotifications">%fa:spinner .pulse .fw%</template>{{ fetchingMoreNotifications ? '%i18n:!common.loading%' : '%i18n:!@more%' }}
|
<template v-if="fetchingMoreNotifications">%fa:spinner .pulse .fw%</template>{{ fetchingMoreNotifications ? '%i18n:!common.loading%' : '%i18n:!@more%' }}
|
||||||
@ -185,98 +187,108 @@ export default Vue.extend({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.mk-notifications
|
root(isDark)
|
||||||
|
.transition
|
||||||
|
.mk-notifications-enter
|
||||||
|
.mk-notifications-leave-to
|
||||||
|
opacity 0
|
||||||
|
transform translateY(-30px)
|
||||||
|
|
||||||
|
> *
|
||||||
|
transition transform .3s ease, opacity .3s ease
|
||||||
|
|
||||||
> .notifications
|
> .notifications
|
||||||
> .notification
|
> *
|
||||||
margin 0
|
> .notification
|
||||||
padding 16px
|
margin 0
|
||||||
overflow-wrap break-word
|
padding 16px
|
||||||
font-size 0.9em
|
overflow-wrap break-word
|
||||||
border-bottom solid 1px rgba(0, 0, 0, 0.05)
|
font-size 0.9em
|
||||||
|
border-bottom solid 1px isDark ? #1c2023 : rgba(0, 0, 0, 0.05)
|
||||||
|
|
||||||
&:last-child
|
&:last-child
|
||||||
border-bottom none
|
border-bottom none
|
||||||
|
|
||||||
> .mk-time
|
> .mk-time
|
||||||
display inline
|
display inline
|
||||||
position absolute
|
position absolute
|
||||||
top 16px
|
top 16px
|
||||||
right 12px
|
right 12px
|
||||||
vertical-align top
|
vertical-align top
|
||||||
color rgba(0, 0, 0, 0.6)
|
color isDark ? #606984 : rgba(0, 0, 0, 0.6)
|
||||||
font-size small
|
font-size small
|
||||||
|
|
||||||
&:after
|
&:after
|
||||||
content ""
|
content ""
|
||||||
display block
|
|
||||||
clear both
|
|
||||||
|
|
||||||
> .avatar-anchor
|
|
||||||
display block
|
|
||||||
float left
|
|
||||||
position -webkit-sticky
|
|
||||||
position sticky
|
|
||||||
top 16px
|
|
||||||
|
|
||||||
> img
|
|
||||||
display block
|
display block
|
||||||
min-width 36px
|
clear both
|
||||||
min-height 36px
|
|
||||||
max-width 36px
|
|
||||||
max-height 36px
|
|
||||||
border-radius 6px
|
|
||||||
|
|
||||||
> .text
|
> .avatar-anchor
|
||||||
float right
|
display block
|
||||||
width calc(100% - 36px)
|
float left
|
||||||
padding-left 8px
|
position -webkit-sticky
|
||||||
|
position sticky
|
||||||
|
top 16px
|
||||||
|
|
||||||
p
|
> img
|
||||||
margin 0
|
display block
|
||||||
|
min-width 36px
|
||||||
|
min-height 36px
|
||||||
|
max-width 36px
|
||||||
|
max-height 36px
|
||||||
|
border-radius 6px
|
||||||
|
|
||||||
i, .mk-reaction-icon
|
> .text
|
||||||
margin-right 4px
|
float right
|
||||||
|
width calc(100% - 36px)
|
||||||
|
padding-left 8px
|
||||||
|
|
||||||
.note-preview
|
p
|
||||||
color rgba(0, 0, 0, 0.7)
|
margin 0
|
||||||
|
|
||||||
.note-ref
|
i, .mk-reaction-icon
|
||||||
color rgba(0, 0, 0, 0.7)
|
margin-right 4px
|
||||||
|
|
||||||
|
.note-preview
|
||||||
|
color isDark ? #c2cad4 : rgba(0, 0, 0, 0.7)
|
||||||
|
|
||||||
|
.note-ref
|
||||||
|
color isDark ? #c2cad4 : rgba(0, 0, 0, 0.7)
|
||||||
|
|
||||||
|
[data-fa]
|
||||||
|
font-size 1em
|
||||||
|
font-weight normal
|
||||||
|
font-style normal
|
||||||
|
display inline-block
|
||||||
|
margin-right 3px
|
||||||
|
|
||||||
|
&.renote, &.quote
|
||||||
|
.text p i
|
||||||
|
color #77B255
|
||||||
|
|
||||||
|
&.follow
|
||||||
|
.text p i
|
||||||
|
color #53c7ce
|
||||||
|
|
||||||
|
&.reply, &.mention
|
||||||
|
.text p i
|
||||||
|
color #555
|
||||||
|
|
||||||
|
> .date
|
||||||
|
display block
|
||||||
|
margin 0
|
||||||
|
line-height 32px
|
||||||
|
text-align center
|
||||||
|
font-size 0.8em
|
||||||
|
color isDark ? #666b79 : #aaa
|
||||||
|
background isDark ? #242731 : #fdfdfd
|
||||||
|
border-bottom solid 1px isDark ? #1c2023 : rgba(0, 0, 0, 0.05)
|
||||||
|
|
||||||
|
span
|
||||||
|
margin 0 16px
|
||||||
|
|
||||||
[data-fa]
|
[data-fa]
|
||||||
font-size 1em
|
margin-right 8px
|
||||||
font-weight normal
|
|
||||||
font-style normal
|
|
||||||
display inline-block
|
|
||||||
margin-right 3px
|
|
||||||
|
|
||||||
&.renote, &.quote
|
|
||||||
.text p i
|
|
||||||
color #77B255
|
|
||||||
|
|
||||||
&.follow
|
|
||||||
.text p i
|
|
||||||
color #53c7ce
|
|
||||||
|
|
||||||
&.reply, &.mention
|
|
||||||
.text p i
|
|
||||||
color #555
|
|
||||||
|
|
||||||
> .date
|
|
||||||
display block
|
|
||||||
margin 0
|
|
||||||
line-height 32px
|
|
||||||
text-align center
|
|
||||||
font-size 0.8em
|
|
||||||
color #aaa
|
|
||||||
background #fdfdfd
|
|
||||||
border-bottom solid 1px rgba(0, 0, 0, 0.05)
|
|
||||||
|
|
||||||
span
|
|
||||||
margin 0 16px
|
|
||||||
|
|
||||||
[data-fa]
|
|
||||||
margin-right 8px
|
|
||||||
|
|
||||||
> .more
|
> .more
|
||||||
display block
|
display block
|
||||||
@ -312,4 +324,10 @@ export default Vue.extend({
|
|||||||
> [data-fa]
|
> [data-fa]
|
||||||
margin-right 4px
|
margin-right 4px
|
||||||
|
|
||||||
|
.mk-notifications[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mk-notifications:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
@drop.stop="onDrop"
|
@drop.stop="onDrop"
|
||||||
>
|
>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
<input v-show="useCw" v-model="cw" placeholder="内容への注釈 (オプション)">
|
||||||
<textarea :class="{ with: (files.length != 0 || poll) }"
|
<textarea :class="{ with: (files.length != 0 || poll) }"
|
||||||
ref="text" v-model="text" :disabled="posting"
|
ref="text" v-model="text" :disabled="posting"
|
||||||
@keydown="onKeydown" @paste="onPaste" :placeholder="placeholder"
|
@keydown="onKeydown" @paste="onPaste" :placeholder="placeholder"
|
||||||
@ -27,6 +28,7 @@
|
|||||||
<button class="drive" title="%i18n:@attach-media-from-drive%" @click="chooseFileFromDrive">%fa:cloud%</button>
|
<button class="drive" title="%i18n:@attach-media-from-drive%" @click="chooseFileFromDrive">%fa:cloud%</button>
|
||||||
<button class="kao" title="%i18n:@insert-a-kao%" @click="kao">%fa:R smile%</button>
|
<button class="kao" title="%i18n:@insert-a-kao%" @click="kao">%fa:R smile%</button>
|
||||||
<button class="poll" title="%i18n:@create-poll%" @click="poll = true">%fa:chart-pie%</button>
|
<button class="poll" title="%i18n:@create-poll%" @click="poll = true">%fa:chart-pie%</button>
|
||||||
|
<button class="poll" title="内容を隠す" @click="useCw = !useCw">%fa:eye-slash%</button>
|
||||||
<button class="geo" title="位置情報を添付する" @click="geo ? removeGeo() : setGeo()">%fa:map-marker-alt%</button>
|
<button class="geo" title="位置情報を添付する" @click="geo ? removeGeo() : setGeo()">%fa:map-marker-alt%</button>
|
||||||
<p class="text-count" :class="{ over: text.length > 1000 }">{{ '%i18n:!@text-remain%'.replace('{}', 1000 - text.length) }}</p>
|
<p class="text-count" :class="{ over: text.length > 1000 }">{{ '%i18n:!@text-remain%'.replace('{}', 1000 - text.length) }}</p>
|
||||||
<button :class="{ posting }" class="submit" :disabled="!canPost" @click="post">
|
<button :class="{ posting }" class="submit" :disabled="!canPost" @click="post">
|
||||||
@ -46,7 +48,9 @@ export default Vue.extend({
|
|||||||
components: {
|
components: {
|
||||||
XDraggable
|
XDraggable
|
||||||
},
|
},
|
||||||
|
|
||||||
props: ['reply', 'renote'],
|
props: ['reply', 'renote'],
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
posting: false,
|
posting: false,
|
||||||
@ -54,11 +58,14 @@ export default Vue.extend({
|
|||||||
files: [],
|
files: [],
|
||||||
uploadings: [],
|
uploadings: [],
|
||||||
poll: false,
|
poll: false,
|
||||||
|
useCw: false,
|
||||||
|
cw: null,
|
||||||
geo: null,
|
geo: null,
|
||||||
autocomplete: null,
|
autocomplete: null,
|
||||||
draghover: false
|
draghover: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
draftId(): string {
|
draftId(): string {
|
||||||
return this.renote
|
return this.renote
|
||||||
@ -67,6 +74,7 @@ export default Vue.extend({
|
|||||||
? 'reply:' + this.reply.id
|
? 'reply:' + this.reply.id
|
||||||
: 'note';
|
: 'note';
|
||||||
},
|
},
|
||||||
|
|
||||||
placeholder(): string {
|
placeholder(): string {
|
||||||
return this.renote
|
return this.renote
|
||||||
? '%i18n:!@quote-placeholder%'
|
? '%i18n:!@quote-placeholder%'
|
||||||
@ -74,6 +82,7 @@ export default Vue.extend({
|
|||||||
? '%i18n:!@reply-placeholder%'
|
? '%i18n:!@reply-placeholder%'
|
||||||
: '%i18n:!@note-placeholder%';
|
: '%i18n:!@note-placeholder%';
|
||||||
},
|
},
|
||||||
|
|
||||||
submitText(): string {
|
submitText(): string {
|
||||||
return this.renote
|
return this.renote
|
||||||
? '%i18n:!@renote%'
|
? '%i18n:!@renote%'
|
||||||
@ -81,21 +90,26 @@ export default Vue.extend({
|
|||||||
? '%i18n:!@reply%'
|
? '%i18n:!@reply%'
|
||||||
: '%i18n:!@note%';
|
: '%i18n:!@note%';
|
||||||
},
|
},
|
||||||
|
|
||||||
canPost(): boolean {
|
canPost(): boolean {
|
||||||
return !this.posting && (this.text.length != 0 || this.files.length != 0 || this.poll || this.renote);
|
return !this.posting && (this.text.length != 0 || this.files.length != 0 || this.poll || this.renote);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
text() {
|
text() {
|
||||||
this.saveDraft();
|
this.saveDraft();
|
||||||
},
|
},
|
||||||
|
|
||||||
poll() {
|
poll() {
|
||||||
this.saveDraft();
|
this.saveDraft();
|
||||||
},
|
},
|
||||||
|
|
||||||
files() {
|
files() {
|
||||||
this.saveDraft();
|
this.saveDraft();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
// 書きかけの投稿を復元
|
// 書きかけの投稿を復元
|
||||||
@ -113,13 +127,16 @@ export default Vue.extend({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
focus() {
|
focus() {
|
||||||
(this.$refs.text as any).focus();
|
(this.$refs.text as any).focus();
|
||||||
},
|
},
|
||||||
|
|
||||||
chooseFile() {
|
chooseFile() {
|
||||||
(this.$refs.file as any).click();
|
(this.$refs.file as any).click();
|
||||||
},
|
},
|
||||||
|
|
||||||
chooseFileFromDrive() {
|
chooseFileFromDrive() {
|
||||||
(this as any).apis.chooseDriveFile({
|
(this as any).apis.chooseDriveFile({
|
||||||
multiple: true
|
multiple: true
|
||||||
@ -127,32 +144,40 @@ export default Vue.extend({
|
|||||||
files.forEach(this.attachMedia);
|
files.forEach(this.attachMedia);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
attachMedia(driveFile) {
|
attachMedia(driveFile) {
|
||||||
this.files.push(driveFile);
|
this.files.push(driveFile);
|
||||||
this.$emit('change-attached-media', this.files);
|
this.$emit('change-attached-media', this.files);
|
||||||
},
|
},
|
||||||
|
|
||||||
detachMedia(id) {
|
detachMedia(id) {
|
||||||
this.files = this.files.filter(x => x.id != id);
|
this.files = this.files.filter(x => x.id != id);
|
||||||
this.$emit('change-attached-media', this.files);
|
this.$emit('change-attached-media', this.files);
|
||||||
},
|
},
|
||||||
|
|
||||||
onChangeFile() {
|
onChangeFile() {
|
||||||
Array.from((this.$refs.file as any).files).forEach(this.upload);
|
Array.from((this.$refs.file as any).files).forEach(this.upload);
|
||||||
},
|
},
|
||||||
|
|
||||||
upload(file) {
|
upload(file) {
|
||||||
(this.$refs.uploader as any).upload(file);
|
(this.$refs.uploader as any).upload(file);
|
||||||
},
|
},
|
||||||
|
|
||||||
onChangeUploadings(uploads) {
|
onChangeUploadings(uploads) {
|
||||||
this.$emit('change-uploadings', uploads);
|
this.$emit('change-uploadings', uploads);
|
||||||
},
|
},
|
||||||
|
|
||||||
clear() {
|
clear() {
|
||||||
this.text = '';
|
this.text = '';
|
||||||
this.files = [];
|
this.files = [];
|
||||||
this.poll = false;
|
this.poll = false;
|
||||||
this.$emit('change-attached-media', this.files);
|
this.$emit('change-attached-media', this.files);
|
||||||
},
|
},
|
||||||
|
|
||||||
onKeydown(e) {
|
onKeydown(e) {
|
||||||
if ((e.which == 10 || e.which == 13) && (e.ctrlKey || e.metaKey)) this.post();
|
if ((e.which == 10 || e.which == 13) && (e.ctrlKey || e.metaKey)) this.post();
|
||||||
},
|
},
|
||||||
|
|
||||||
onPaste(e) {
|
onPaste(e) {
|
||||||
Array.from(e.clipboardData.items).forEach((item: any) => {
|
Array.from(e.clipboardData.items).forEach((item: any) => {
|
||||||
if (item.kind == 'file') {
|
if (item.kind == 'file') {
|
||||||
@ -160,6 +185,7 @@ export default Vue.extend({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onDragover(e) {
|
onDragover(e) {
|
||||||
const isFile = e.dataTransfer.items[0].kind == 'file';
|
const isFile = e.dataTransfer.items[0].kind == 'file';
|
||||||
const isDriveFile = e.dataTransfer.types[0] == 'mk_drive_file';
|
const isDriveFile = e.dataTransfer.types[0] == 'mk_drive_file';
|
||||||
@ -169,12 +195,15 @@ export default Vue.extend({
|
|||||||
e.dataTransfer.dropEffect = e.dataTransfer.effectAllowed == 'all' ? 'copy' : 'move';
|
e.dataTransfer.dropEffect = e.dataTransfer.effectAllowed == 'all' ? 'copy' : 'move';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onDragenter(e) {
|
onDragenter(e) {
|
||||||
this.draghover = true;
|
this.draghover = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
onDragleave(e) {
|
onDragleave(e) {
|
||||||
this.draghover = false;
|
this.draghover = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
onDrop(e): void {
|
onDrop(e): void {
|
||||||
this.draghover = false;
|
this.draghover = false;
|
||||||
|
|
||||||
@ -195,6 +224,7 @@ export default Vue.extend({
|
|||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
},
|
},
|
||||||
|
|
||||||
setGeo() {
|
setGeo() {
|
||||||
if (navigator.geolocation == null) {
|
if (navigator.geolocation == null) {
|
||||||
alert('お使いの端末は位置情報に対応していません');
|
alert('お使いの端末は位置情報に対応していません');
|
||||||
@ -210,10 +240,12 @@ export default Vue.extend({
|
|||||||
enableHighAccuracy: true
|
enableHighAccuracy: true
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
removeGeo() {
|
removeGeo() {
|
||||||
this.geo = null;
|
this.geo = null;
|
||||||
this.$emit('geo-dettached');
|
this.$emit('geo-dettached');
|
||||||
},
|
},
|
||||||
|
|
||||||
post() {
|
post() {
|
||||||
this.posting = true;
|
this.posting = true;
|
||||||
|
|
||||||
@ -223,6 +255,7 @@ export default Vue.extend({
|
|||||||
replyId: this.reply ? this.reply.id : undefined,
|
replyId: this.reply ? this.reply.id : undefined,
|
||||||
renoteId: this.renote ? this.renote.id : undefined,
|
renoteId: this.renote ? this.renote.id : undefined,
|
||||||
poll: this.poll ? (this.$refs.poll as any).get() : undefined,
|
poll: this.poll ? (this.$refs.poll as any).get() : undefined,
|
||||||
|
cw: this.useCw ? this.cw || '' : undefined,
|
||||||
geo: this.geo ? {
|
geo: this.geo ? {
|
||||||
coordinates: [this.geo.longitude, this.geo.latitude],
|
coordinates: [this.geo.longitude, this.geo.latitude],
|
||||||
altitude: this.geo.altitude,
|
altitude: this.geo.altitude,
|
||||||
@ -250,6 +283,7 @@ export default Vue.extend({
|
|||||||
this.posting = false;
|
this.posting = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
saveDraft() {
|
saveDraft() {
|
||||||
const data = JSON.parse(localStorage.getItem('drafts') || '{}');
|
const data = JSON.parse(localStorage.getItem('drafts') || '{}');
|
||||||
|
|
||||||
@ -264,6 +298,7 @@ export default Vue.extend({
|
|||||||
|
|
||||||
localStorage.setItem('drafts', JSON.stringify(data));
|
localStorage.setItem('drafts', JSON.stringify(data));
|
||||||
},
|
},
|
||||||
|
|
||||||
deleteDraft() {
|
deleteDraft() {
|
||||||
const data = JSON.parse(localStorage.getItem('drafts') || '{}');
|
const data = JSON.parse(localStorage.getItem('drafts') || '{}');
|
||||||
|
|
||||||
@ -271,6 +306,7 @@ export default Vue.extend({
|
|||||||
|
|
||||||
localStorage.setItem('drafts', JSON.stringify(data));
|
localStorage.setItem('drafts', JSON.stringify(data));
|
||||||
},
|
},
|
||||||
|
|
||||||
kao() {
|
kao() {
|
||||||
this.text += getKao();
|
this.text += getKao();
|
||||||
}
|
}
|
||||||
@ -281,10 +317,10 @@ export default Vue.extend({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
.mk-post-form
|
root(isDark)
|
||||||
display block
|
display block
|
||||||
padding 16px
|
padding 16px
|
||||||
background lighten($theme-color, 95%)
|
background isDark ? #282C37 : lighten($theme-color, 95%)
|
||||||
|
|
||||||
&:after
|
&:after
|
||||||
content ""
|
content ""
|
||||||
@ -293,47 +329,54 @@ export default Vue.extend({
|
|||||||
|
|
||||||
> .content
|
> .content
|
||||||
|
|
||||||
textarea
|
> input
|
||||||
|
> textarea
|
||||||
display block
|
display block
|
||||||
padding 12px
|
|
||||||
margin 0
|
|
||||||
width 100%
|
width 100%
|
||||||
max-width 100%
|
padding 12px
|
||||||
min-width 100%
|
|
||||||
min-height calc(16px + 12px + 12px)
|
|
||||||
font-size 16px
|
font-size 16px
|
||||||
color #333
|
color isDark ? #fff : #333
|
||||||
background #fff
|
background isDark ? #191d23 : #fff
|
||||||
outline none
|
outline none
|
||||||
border solid 1px rgba($theme-color, 0.1)
|
border solid 1px rgba($theme-color, 0.1)
|
||||||
border-radius 4px
|
border-radius 4px
|
||||||
transition border-color .3s ease
|
transition border-color .2s ease
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
border-color rgba($theme-color, 0.2)
|
border-color rgba($theme-color, 0.2)
|
||||||
transition border-color .1s ease
|
transition border-color .1s ease
|
||||||
|
|
||||||
& + *
|
|
||||||
& + * + *
|
|
||||||
border-color rgba($theme-color, 0.2)
|
|
||||||
transition border-color .1s ease
|
|
||||||
|
|
||||||
&:focus
|
&:focus
|
||||||
color $theme-color
|
|
||||||
border-color rgba($theme-color, 0.5)
|
border-color rgba($theme-color, 0.5)
|
||||||
transition border-color 0s ease
|
transition border-color 0s ease
|
||||||
|
|
||||||
& + *
|
|
||||||
& + * + *
|
|
||||||
border-color rgba($theme-color, 0.5)
|
|
||||||
transition border-color 0s ease
|
|
||||||
|
|
||||||
&:disabled
|
&:disabled
|
||||||
opacity 0.5
|
opacity 0.5
|
||||||
|
|
||||||
&::-webkit-input-placeholder
|
&::-webkit-input-placeholder
|
||||||
color rgba($theme-color, 0.3)
|
color rgba($theme-color, 0.3)
|
||||||
|
|
||||||
|
> input
|
||||||
|
margin-bottom 8px
|
||||||
|
|
||||||
|
> textarea
|
||||||
|
margin 0
|
||||||
|
max-width 100%
|
||||||
|
min-width 100%
|
||||||
|
min-height 64px
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
& + *
|
||||||
|
& + * + *
|
||||||
|
border-color rgba($theme-color, 0.2)
|
||||||
|
transition border-color .1s ease
|
||||||
|
|
||||||
|
&:focus
|
||||||
|
& + *
|
||||||
|
& + * + *
|
||||||
|
border-color rgba($theme-color, 0.5)
|
||||||
|
transition border-color 0s ease
|
||||||
|
|
||||||
&.with
|
&.with
|
||||||
border-bottom solid 1px rgba($theme-color, 0.1) !important
|
border-bottom solid 1px rgba($theme-color, 0.1) !important
|
||||||
border-radius 4px 4px 0 0
|
border-radius 4px 4px 0 0
|
||||||
@ -341,7 +384,7 @@ export default Vue.extend({
|
|||||||
> .medias
|
> .medias
|
||||||
margin 0
|
margin 0
|
||||||
padding 0
|
padding 0
|
||||||
background lighten($theme-color, 98%)
|
background isDark ? #181b23 : lighten($theme-color, 98%)
|
||||||
border solid 1px rgba($theme-color, 0.1)
|
border solid 1px rgba($theme-color, 0.1)
|
||||||
border-top none
|
border-top none
|
||||||
border-radius 0 0 4px 4px
|
border-radius 0 0 4px 4px
|
||||||
@ -392,7 +435,7 @@ export default Vue.extend({
|
|||||||
cursor pointer
|
cursor pointer
|
||||||
|
|
||||||
> .mk-poll-editor
|
> .mk-poll-editor
|
||||||
background lighten($theme-color, 98%)
|
background isDark ? #181b23 : lighten($theme-color, 98%)
|
||||||
border solid 1px rgba($theme-color, 0.1)
|
border solid 1px rgba($theme-color, 0.1)
|
||||||
border-top none
|
border-top none
|
||||||
border-radius 0 0 4px 4px
|
border-radius 0 0 4px 4px
|
||||||
@ -496,7 +539,7 @@ export default Vue.extend({
|
|||||||
width 40px
|
width 40px
|
||||||
height 40px
|
height 40px
|
||||||
font-size 1em
|
font-size 1em
|
||||||
color rgba($theme-color, 0.5)
|
color isDark ? $theme-color : rgba($theme-color, 0.5)
|
||||||
background transparent
|
background transparent
|
||||||
outline none
|
outline none
|
||||||
border solid 1px transparent
|
border solid 1px transparent
|
||||||
@ -504,11 +547,11 @@ export default Vue.extend({
|
|||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
background transparent
|
background transparent
|
||||||
border-color rgba($theme-color, 0.3)
|
border-color isDark ? rgba($theme-color, 0.5) : rgba($theme-color, 0.3)
|
||||||
|
|
||||||
&:active
|
&:active
|
||||||
color rgba($theme-color, 0.6)
|
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)
|
border-color rgba($theme-color, 0.5)
|
||||||
box-shadow 0 2px 4px rgba(0, 0, 0, 0.15) inset
|
box-shadow 0 2px 4px rgba(0, 0, 0, 0.15) inset
|
||||||
|
|
||||||
@ -533,4 +576,10 @@ export default Vue.extend({
|
|||||||
border dashed 2px rgba($theme-color, 0.5)
|
border dashed 2px rgba($theme-color, 0.5)
|
||||||
pointer-events none
|
pointer-events none
|
||||||
|
|
||||||
|
.mk-post-form[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mk-post-form:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
<template v-if="!quote">
|
<template v-if="!quote">
|
||||||
<footer>
|
<footer>
|
||||||
<a class="quote" v-if="!quote" @click="onQuote">%i18n:@quote%</a>
|
<a class="quote" v-if="!quote" @click="onQuote">%i18n:@quote%</a>
|
||||||
<button class="cancel" @click="cancel">%i18n:@cancel%</button>
|
<button class="ui cancel" @click="cancel">%i18n:@cancel%</button>
|
||||||
<button class="ok" @click="ok" :disabled="wait">{{ wait ? '%i18n:!@reposting%' : '%i18n:!@renote%' }}</button>
|
<button class="ui primary ok" @click="ok" :disabled="wait">{{ wait ? '%i18n:!@reposting%' : '%i18n:!@renote%' }}</button>
|
||||||
</footer>
|
</footer>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="quote">
|
<template v-if="quote">
|
||||||
@ -59,14 +59,14 @@ export default Vue.extend({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
.mk-renote-form
|
root(isDark)
|
||||||
|
|
||||||
> .mk-note-preview
|
> .mk-note-preview
|
||||||
margin 16px 22px
|
margin 16px 22px
|
||||||
|
|
||||||
> footer
|
> footer
|
||||||
height 72px
|
height 72px
|
||||||
background lighten($theme-color, 95%)
|
background isDark ? #313543 : lighten($theme-color, 95%)
|
||||||
|
|
||||||
> .quote
|
> .quote
|
||||||
position absolute
|
position absolute
|
||||||
@ -78,54 +78,19 @@ export default Vue.extend({
|
|||||||
display block
|
display block
|
||||||
position absolute
|
position absolute
|
||||||
bottom 16px
|
bottom 16px
|
||||||
cursor pointer
|
|
||||||
padding 0
|
|
||||||
margin 0
|
|
||||||
width 120px
|
width 120px
|
||||||
height 40px
|
height 40px
|
||||||
font-size 1em
|
|
||||||
outline none
|
|
||||||
border-radius 4px
|
|
||||||
|
|
||||||
&:focus
|
&.cancel
|
||||||
&:after
|
right 148px
|
||||||
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
|
&.ok
|
||||||
right 148px
|
right 16px
|
||||||
color #888
|
|
||||||
background linear-gradient(to bottom, #ffffff 0%, #f5f5f5 100%)
|
|
||||||
border solid 1px #e2e2e2
|
|
||||||
|
|
||||||
&:hover
|
.mk-renote-form[data-darkmode]
|
||||||
background linear-gradient(to bottom, #f9f9f9 0%, #ececec 100%)
|
root(true)
|
||||||
border-color #dcdcdc
|
|
||||||
|
|
||||||
&:active
|
.mk-renote-form:not([data-darkmode])
|
||||||
background #ececec
|
root(false)
|
||||||
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>
|
</style>
|
||||||
|
@ -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>
|
|
@ -29,8 +29,6 @@ export default Vue.extend({
|
|||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.root.api
|
.root.api
|
||||||
color #4a535a
|
|
||||||
|
|
||||||
code
|
code
|
||||||
display inline-block
|
display inline-block
|
||||||
padding 4px 6px
|
padding 4px 6px
|
||||||
|
@ -37,14 +37,19 @@
|
|||||||
<section class="web" v-show="page == 'web'">
|
<section class="web" v-show="page == 'web'">
|
||||||
<h1>デザインと表示</h1>
|
<h1>デザインと表示</h1>
|
||||||
<div class="div">
|
<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="darkmode" text="ダークモード"/>
|
||||||
|
<mk-switch v-model="os.i.clientSettings.gradientWindowHeader" @change="onChangeGradientWindowHeader" text="ウィンドウのタイトルバーにグラデーションを使用"/>
|
||||||
</div>
|
</div>
|
||||||
<mk-switch v-model="os.i.clientSettings.showPostFormOnTopOfTl" @change="onChangeShowPostFormOnTopOfTl" text="タイムライン上部に投稿フォームを表示する"/>
|
<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.showReplyTarget" @change="onChangeShowReplyTarget" text="リプライ先を表示する"/>
|
||||||
|
<mk-switch v-model="os.i.clientSettings.showMyRenotes" @change="onChangeShowMyRenotes" text="自分の行ったRenoteをタイムラインに表示する"/>
|
||||||
|
<mk-switch v-model="os.i.clientSettings.showRenotedMyNotes" @change="onChangeShowRenotedMyNotes" text="Renoteされた自分の投稿をタイムラインに表示する"/>
|
||||||
<mk-switch v-model="os.i.clientSettings.showMaps" @change="onChangeShowMaps" text="マップの自動展開">
|
<mk-switch v-model="os.i.clientSettings.showMaps" @change="onChangeShowMaps" text="マップの自動展開">
|
||||||
<span>位置情報が添付された投稿のマップを自動的に展開します。</span>
|
<span>位置情報が添付された投稿のマップを自動的に展開します。</span>
|
||||||
</mk-switch>
|
</mk-switch>
|
||||||
<mk-switch v-model="os.i.clientSettings.gradientWindowHeader" @change="onChangeGradientWindowHeader" text="ウィンドウのタイトルバーにグラデーションを使用"/>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="web" v-show="page == 'web'">
|
<section class="web" v-show="page == 'web'">
|
||||||
@ -229,6 +234,7 @@ export default Vue.extend({
|
|||||||
version,
|
version,
|
||||||
latestVersion: undefined,
|
latestVersion: undefined,
|
||||||
checkingForUpdate: false,
|
checkingForUpdate: false,
|
||||||
|
darkmode: localStorage.getItem('darkmode') == 'true',
|
||||||
enableSounds: localStorage.getItem('enableSounds') == 'true',
|
enableSounds: localStorage.getItem('enableSounds') == 'true',
|
||||||
autoPopout: localStorage.getItem('autoPopout') == 'true',
|
autoPopout: localStorage.getItem('autoPopout') == 'true',
|
||||||
apiViaStream: localStorage.getItem('apiViaStream') ? localStorage.getItem('apiViaStream') == 'true' : true,
|
apiViaStream: localStorage.getItem('apiViaStream') ? localStorage.getItem('apiViaStream') == 'true' : true,
|
||||||
@ -252,6 +258,9 @@ export default Vue.extend({
|
|||||||
apiViaStream() {
|
apiViaStream() {
|
||||||
localStorage.setItem('apiViaStream', this.apiViaStream ? 'true' : 'false');
|
localStorage.setItem('apiViaStream', this.apiViaStream ? 'true' : 'false');
|
||||||
},
|
},
|
||||||
|
darkmode() {
|
||||||
|
(this as any)._updateDarkmode_(this.darkmode);
|
||||||
|
},
|
||||||
enableSounds() {
|
enableSounds() {
|
||||||
localStorage.setItem('enableSounds', this.enableSounds ? 'true' : 'false');
|
localStorage.setItem('enableSounds', this.enableSounds ? 'true' : 'false');
|
||||||
},
|
},
|
||||||
@ -298,6 +307,12 @@ export default Vue.extend({
|
|||||||
autoWatch: v
|
autoWatch: v
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
onChangeDark(v) {
|
||||||
|
(this as any).api('i/update_client_setting', {
|
||||||
|
name: 'dark',
|
||||||
|
value: v
|
||||||
|
});
|
||||||
|
},
|
||||||
onChangeShowPostFormOnTopOfTl(v) {
|
onChangeShowPostFormOnTopOfTl(v) {
|
||||||
(this as any).api('i/update_client_setting', {
|
(this as any).api('i/update_client_setting', {
|
||||||
name: 'showPostFormOnTopOfTl',
|
name: 'showPostFormOnTopOfTl',
|
||||||
@ -310,6 +325,18 @@ export default Vue.extend({
|
|||||||
value: v
|
value: v
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
onChangeShowMyRenotes(v) {
|
||||||
|
(this as any).api('i/update_client_setting', {
|
||||||
|
name: 'showMyRenotes',
|
||||||
|
value: v
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onChangeShowRenotedMyNotes(v) {
|
||||||
|
(this as any).api('i/update_client_setting', {
|
||||||
|
name: 'showRenotedMyNotes',
|
||||||
|
value: v
|
||||||
|
});
|
||||||
|
},
|
||||||
onChangeShowMaps(v) {
|
onChangeShowMaps(v) {
|
||||||
(this as any).api('i/update_client_setting', {
|
(this as any).api('i/update_client_setting', {
|
||||||
name: 'showMaps',
|
name: 'showMaps',
|
||||||
@ -365,7 +392,7 @@ export default Vue.extend({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
.mk-settings
|
root(isDark)
|
||||||
display flex
|
display flex
|
||||||
width 100%
|
width 100%
|
||||||
height 100%
|
height 100%
|
||||||
@ -376,13 +403,13 @@ export default Vue.extend({
|
|||||||
height 100%
|
height 100%
|
||||||
padding 16px 0 0 0
|
padding 16px 0 0 0
|
||||||
overflow auto
|
overflow auto
|
||||||
border-right solid 1px #ddd
|
border-right solid 1px isDark ? #1c2023 : #ddd
|
||||||
|
|
||||||
> p
|
> p
|
||||||
display block
|
display block
|
||||||
padding 10px 16px
|
padding 10px 16px
|
||||||
margin 0
|
margin 0
|
||||||
color #666
|
color isDark ? #9aa2a7 : #666
|
||||||
cursor pointer
|
cursor pointer
|
||||||
user-select none
|
user-select none
|
||||||
transition margin-left 0.2s ease
|
transition margin-left 0.2s ease
|
||||||
@ -391,7 +418,7 @@ export default Vue.extend({
|
|||||||
margin-right 4px
|
margin-right 4px
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
color #555
|
color isDark ? #fff : #555
|
||||||
|
|
||||||
&.active
|
&.active
|
||||||
margin-left 8px
|
margin-left 8px
|
||||||
@ -405,14 +432,14 @@ export default Vue.extend({
|
|||||||
|
|
||||||
> section
|
> section
|
||||||
margin 32px
|
margin 32px
|
||||||
color #4a535a
|
color isDark ? #c4ccd2 : #4a535a
|
||||||
|
|
||||||
> h1
|
> h1
|
||||||
margin 0 0 1em 0
|
margin 0 0 1em 0
|
||||||
padding 0 0 8px 0
|
padding 0 0 8px 0
|
||||||
font-size 1em
|
font-size 1em
|
||||||
color #555
|
color isDark ? #e3e7ea : #555
|
||||||
border-bottom solid 1px #eee
|
border-bottom solid 1px isDark ? #1c2023 : #eee
|
||||||
|
|
||||||
&, >>> *
|
&, >>> *
|
||||||
.ui.button.block
|
.ui.button.block
|
||||||
@ -425,13 +452,18 @@ export default Vue.extend({
|
|||||||
margin 0 0 1em 0
|
margin 0 0 1em 0
|
||||||
padding 0 0 8px 0
|
padding 0 0 8px 0
|
||||||
font-size 1em
|
font-size 1em
|
||||||
color #555
|
color isDark ? #e3e7ea : #555
|
||||||
border-bottom solid 1px #eee
|
border-bottom solid 1px isDark ? #1c2023 : #eee
|
||||||
|
|
||||||
> .web
|
> .web
|
||||||
> .div
|
> .div
|
||||||
border-bottom solid 1px #eee
|
border-bottom solid 1px isDark ? #1c2023 : #eee
|
||||||
padding 0 0 16px 0
|
margin 16px 0
|
||||||
margin 0 0 16px 0
|
|
||||||
|
.mk-settings[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mk-settings:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mk-home-timeline">
|
<div class="mk-home-timeline">
|
||||||
|
<div class="newer-indicator" :style="{ top: $store.state.uiHeaderHeight + 'px' }" v-show="queue.length > 0"></div>
|
||||||
<mk-friends-maker v-if="src == 'home' && alone"/>
|
<mk-friends-maker v-if="src == 'home' && alone"/>
|
||||||
<div class="fetching" v-if="fetching">
|
<div class="fetching" v-if="fetching">
|
||||||
<mk-ellipsis-icon/>
|
<mk-ellipsis-icon/>
|
||||||
@ -20,6 +21,9 @@
|
|||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import { url } from '../../../config';
|
import { url } from '../../../config';
|
||||||
|
|
||||||
|
const fetchLimit = 10;
|
||||||
|
const displayLimit = 30;
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
props: {
|
props: {
|
||||||
src: {
|
src: {
|
||||||
@ -34,6 +38,7 @@ export default Vue.extend({
|
|||||||
moreFetching: false,
|
moreFetching: false,
|
||||||
existMore: false,
|
existMore: false,
|
||||||
notes: [],
|
notes: [],
|
||||||
|
queue: [],
|
||||||
connection: null,
|
connection: null,
|
||||||
connectionId: null,
|
connectionId: null,
|
||||||
date: null
|
date: null
|
||||||
@ -59,6 +64,10 @@ export default Vue.extend({
|
|||||||
: this.src == 'local'
|
: this.src == 'local'
|
||||||
? 'notes/local-timeline'
|
? 'notes/local-timeline'
|
||||||
: 'notes/global-timeline';
|
: 'notes/global-timeline';
|
||||||
|
},
|
||||||
|
|
||||||
|
canFetchMore(): boolean {
|
||||||
|
return !this.moreFetching && !this.fetching && this.notes.length > 0 && this.existMore;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -72,6 +81,9 @@ export default Vue.extend({
|
|||||||
this.connection.on('unfollow', this.onChangeFollowing);
|
this.connection.on('unfollow', this.onChangeFollowing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
document.addEventListener('keydown', this.onKeydown);
|
||||||
|
window.addEventListener('scroll', this.onScroll);
|
||||||
|
|
||||||
this.fetch();
|
this.fetch();
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -82,17 +94,27 @@ export default Vue.extend({
|
|||||||
this.connection.off('unfollow', this.onChangeFollowing);
|
this.connection.off('unfollow', this.onChangeFollowing);
|
||||||
}
|
}
|
||||||
this.stream.dispose(this.connectionId);
|
this.stream.dispose(this.connectionId);
|
||||||
|
|
||||||
|
document.removeEventListener('keydown', this.onKeydown);
|
||||||
|
window.removeEventListener('scroll', this.onScroll);
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
isScrollTop() {
|
||||||
|
return window.scrollY <= 8;
|
||||||
|
},
|
||||||
|
|
||||||
fetch(cb?) {
|
fetch(cb?) {
|
||||||
|
this.queue = [];
|
||||||
this.fetching = true;
|
this.fetching = true;
|
||||||
|
|
||||||
(this as any).api(this.endpoint, {
|
(this as any).api(this.endpoint, {
|
||||||
limit: 11,
|
limit: fetchLimit + 1,
|
||||||
untilDate: this.date ? this.date.getTime() : undefined
|
untilDate: this.date ? this.date.getTime() : undefined,
|
||||||
|
includeMyRenotes: (this as any).os.i.clientSettings.showMyRenotes,
|
||||||
|
includeRenotedMyNotes: (this as any).os.i.clientSettings.showRenotedMyNotes
|
||||||
}).then(notes => {
|
}).then(notes => {
|
||||||
if (notes.length == 11) {
|
if (notes.length == fetchLimit + 1) {
|
||||||
notes.pop();
|
notes.pop();
|
||||||
this.existMore = true;
|
this.existMore = true;
|
||||||
}
|
}
|
||||||
@ -104,13 +126,17 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
more() {
|
more() {
|
||||||
if (this.moreFetching || this.fetching || this.notes.length == 0 || !this.existMore) return;
|
if (!this.canFetchMore) return;
|
||||||
|
|
||||||
this.moreFetching = true;
|
this.moreFetching = true;
|
||||||
|
|
||||||
(this as any).api(this.endpoint, {
|
(this as any).api(this.endpoint, {
|
||||||
limit: 11,
|
limit: fetchLimit + 1,
|
||||||
untilId: this.notes[this.notes.length - 1].id
|
untilId: this.notes[this.notes.length - 1].id,
|
||||||
|
includeMyRenotes: (this as any).os.i.clientSettings.showMyRenotes,
|
||||||
|
includeRenotedMyNotes: (this as any).os.i.clientSettings.showRenotedMyNotes
|
||||||
}).then(notes => {
|
}).then(notes => {
|
||||||
if (notes.length == 11) {
|
if (notes.length == fetchLimit + 1) {
|
||||||
notes.pop();
|
notes.pop();
|
||||||
} else {
|
} else {
|
||||||
this.existMore = false;
|
this.existMore = false;
|
||||||
@ -120,18 +146,51 @@ export default Vue.extend({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onNote(note) {
|
prependNote(note, silent = false) {
|
||||||
// サウンドを再生する
|
// サウンドを再生する
|
||||||
if ((this as any).os.isEnableSounds) {
|
if ((this as any).os.isEnableSounds && !silent) {
|
||||||
const sound = new Audio(`${url}/assets/post.mp3`);
|
const sound = new Audio(`${url}/assets/post.mp3`);
|
||||||
sound.volume = localStorage.getItem('soundVolume') ? parseInt(localStorage.getItem('soundVolume'), 10) / 100 : 0.5;
|
sound.volume = localStorage.getItem('soundVolume') ? parseInt(localStorage.getItem('soundVolume'), 10) / 100 : 0.5;
|
||||||
sound.play();
|
sound.play();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Prepent a note
|
||||||
this.notes.unshift(note);
|
this.notes.unshift(note);
|
||||||
|
|
||||||
const isTop = window.scrollY > 8;
|
// オーバーフローしたら古い投稿は捨てる
|
||||||
if (isTop) this.notes.pop();
|
if (this.notes.length >= displayLimit) {
|
||||||
|
this.notes = this.notes.slice(0, displayLimit);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
releaseQueue() {
|
||||||
|
this.queue.forEach(n => this.prependNote(n, true));
|
||||||
|
this.queue = [];
|
||||||
|
},
|
||||||
|
|
||||||
|
onNote(note) {
|
||||||
|
//#region 弾く
|
||||||
|
const isMyNote = note.userId == (this as any).os.i.id;
|
||||||
|
const isPureRenote = note.renoteId != null && note.text == null && note.mediaIds.length == 0 && note.poll == null;
|
||||||
|
|
||||||
|
if ((this as any).os.i.clientSettings.showMyRenotes === false) {
|
||||||
|
if (isMyNote && isPureRenote) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((this as any).os.i.clientSettings.showRenotedMyNotes === false) {
|
||||||
|
if (isPureRenote && (note.renote.userId == (this as any).os.i.id)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
if (this.isScrollTop()) {
|
||||||
|
this.prependNote(note);
|
||||||
|
} else {
|
||||||
|
this.queue.unshift(note);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onChangeFollowing() {
|
onChangeFollowing() {
|
||||||
@ -145,13 +204,41 @@ export default Vue.extend({
|
|||||||
warp(date) {
|
warp(date) {
|
||||||
this.date = date;
|
this.date = date;
|
||||||
this.fetch();
|
this.fetch();
|
||||||
}
|
},
|
||||||
|
|
||||||
|
onScroll() {
|
||||||
|
if ((this as any).os.i.clientSettings.fetchOnScroll !== false) {
|
||||||
|
const current = window.scrollY + window.innerHeight;
|
||||||
|
if (current > document.body.offsetHeight - 8) this.more();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.isScrollTop()) {
|
||||||
|
this.releaseQueue();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onKeydown(e) {
|
||||||
|
if (e.target.tagName != 'INPUT' && e.target.tagName != 'TEXTAREA') {
|
||||||
|
if (e.which == 84) { // t
|
||||||
|
this.focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
|
@import '~const.styl'
|
||||||
|
|
||||||
.mk-home-timeline
|
.mk-home-timeline
|
||||||
|
> .newer-indicator
|
||||||
|
position -webkit-sticky
|
||||||
|
position sticky
|
||||||
|
z-index 100
|
||||||
|
height 3px
|
||||||
|
background $theme-color
|
||||||
|
|
||||||
> .mk-friends-maker
|
> .mk-friends-maker
|
||||||
border-bottom solid 1px #eee
|
border-bottom solid 1px #eee
|
||||||
|
|
||||||
|
@ -27,35 +27,12 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
document.addEventListener('keydown', this.onKeydown);
|
|
||||||
window.addEventListener('scroll', this.onScroll);
|
|
||||||
|
|
||||||
(this.$refs.tl as any).$once('loaded', () => {
|
(this.$refs.tl as any).$once('loaded', () => {
|
||||||
this.$emit('loaded');
|
this.$emit('loaded');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeDestroy() {
|
|
||||||
document.removeEventListener('keydown', this.onKeydown);
|
|
||||||
window.removeEventListener('scroll', this.onScroll);
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onScroll() {
|
|
||||||
if ((this as any).os.i.clientSettings.fetchOnScroll !== false) {
|
|
||||||
const current = window.scrollY + window.innerHeight;
|
|
||||||
if (current > document.body.offsetHeight - 8) (this.$refs.tl as any).more();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
onKeydown(e) {
|
|
||||||
if (e.target.tagName != 'INPUT' && e.target.tagName != 'TEXTAREA') {
|
|
||||||
if (e.which == 84) { // t
|
|
||||||
(this.$refs.tl as any).focus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
warp(date) {
|
warp(date) {
|
||||||
(this.$refs.tl as any).warp(date);
|
(this.$refs.tl as any).warp(date);
|
||||||
}
|
}
|
||||||
@ -66,14 +43,16 @@ export default Vue.extend({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
.mk-timeline
|
root(isDark)
|
||||||
background #fff
|
background isDark ? #282C37 : #fff
|
||||||
border solid 1px rgba(0, 0, 0, 0.075)
|
border solid 1px rgba(0, 0, 0, 0.075)
|
||||||
border-radius 6px
|
border-radius 6px
|
||||||
|
|
||||||
> header
|
> header
|
||||||
padding 0 8px
|
padding 0 8px
|
||||||
z-index 10
|
z-index 10
|
||||||
|
background isDark ? #313543 : #fff
|
||||||
|
border-radius 6px 6px 0 0
|
||||||
box-shadow 0 1px rgba(0, 0, 0, 0.08)
|
box-shadow 0 1px rgba(0, 0, 0, 0.08)
|
||||||
|
|
||||||
> span
|
> span
|
||||||
@ -99,10 +78,16 @@ export default Vue.extend({
|
|||||||
background $theme-color
|
background $theme-color
|
||||||
|
|
||||||
&:not([data-is-active])
|
&:not([data-is-active])
|
||||||
color #6f7477
|
color isDark ? #9aa2a7 : #6f7477
|
||||||
cursor pointer
|
cursor pointer
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
color #525a5f
|
color isDark ? #d9dcde : #525a5f
|
||||||
|
|
||||||
|
.mk-timeline[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mk-timeline:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -8,23 +8,31 @@
|
|||||||
<div class="menu" v-if="isOpen">
|
<div class="menu" v-if="isOpen">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<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>
|
||||||
<li @click="drive">
|
<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>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<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>
|
||||||
<li @click="settings">
|
<li @click="settings">
|
||||||
<p>%fa:cog%%i18n:@settings%%fa:angle-right%</p>
|
<p>%fa:cog%<span>%i18n:@settings%</span>%fa:angle-right%</p>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul>
|
<ul>
|
||||||
<li @click="signout">
|
<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>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -78,6 +86,9 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
signout() {
|
signout() {
|
||||||
(this as any).os.signout();
|
(this as any).os.signout();
|
||||||
|
},
|
||||||
|
dark() {
|
||||||
|
(this as any)._updateDarkmode_(!(this as any)._darkmode_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -86,7 +97,7 @@ export default Vue.extend({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
.account
|
root(isDark)
|
||||||
> .header
|
> .header
|
||||||
display block
|
display block
|
||||||
margin 0
|
margin 0
|
||||||
@ -101,13 +112,13 @@ export default Vue.extend({
|
|||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
&[data-active='true']
|
&[data-active='true']
|
||||||
color darken(#9eaba8, 20%)
|
color isDark ? #fff : darken(#9eaba8, 20%)
|
||||||
|
|
||||||
> .avatar
|
> .avatar
|
||||||
filter saturate(150%)
|
filter saturate(150%)
|
||||||
|
|
||||||
&:active
|
&:active
|
||||||
color darken(#9eaba8, 30%)
|
color isDark ? #fff : darken(#9eaba8, 30%)
|
||||||
|
|
||||||
> .username
|
> .username
|
||||||
display block
|
display block
|
||||||
@ -134,13 +145,14 @@ export default Vue.extend({
|
|||||||
transition filter 100ms ease
|
transition filter 100ms ease
|
||||||
|
|
||||||
> .menu
|
> .menu
|
||||||
|
$bgcolor = isDark ? #282c37 : #fff
|
||||||
display block
|
display block
|
||||||
position absolute
|
position absolute
|
||||||
top 56px
|
top 56px
|
||||||
right -2px
|
right -2px
|
||||||
width 230px
|
width 230px
|
||||||
font-size 0.8em
|
font-size 0.8em
|
||||||
background #fff
|
background $bgcolor
|
||||||
border-radius 4px
|
border-radius 4px
|
||||||
box-shadow 0 1px 4px rgba(0, 0, 0, 0.25)
|
box-shadow 0 1px 4px rgba(0, 0, 0, 0.25)
|
||||||
|
|
||||||
@ -165,7 +177,7 @@ export default Vue.extend({
|
|||||||
right 12px
|
right 12px
|
||||||
border-top solid 14px transparent
|
border-top solid 14px transparent
|
||||||
border-right solid 14px transparent
|
border-right solid 14px transparent
|
||||||
border-bottom solid 14px #fff
|
border-bottom solid 14px $bgcolor
|
||||||
border-left solid 14px transparent
|
border-left solid 14px transparent
|
||||||
|
|
||||||
ul
|
ul
|
||||||
@ -176,7 +188,7 @@ export default Vue.extend({
|
|||||||
|
|
||||||
& + ul
|
& + ul
|
||||||
padding-top 10px
|
padding-top 10px
|
||||||
border-top solid 1px #eee
|
border-top solid 1px isDark ? #1c2023 : #eee
|
||||||
|
|
||||||
> li
|
> li
|
||||||
display block
|
display block
|
||||||
@ -190,16 +202,20 @@ export default Vue.extend({
|
|||||||
padding 0 28px
|
padding 0 28px
|
||||||
margin 0
|
margin 0
|
||||||
line-height 40px
|
line-height 40px
|
||||||
color #868C8C
|
color isDark ? #c8cece : #868C8C
|
||||||
cursor pointer
|
cursor pointer
|
||||||
|
|
||||||
*
|
*
|
||||||
pointer-events none
|
pointer-events none
|
||||||
|
|
||||||
> [data-fa]:first-of-type
|
> span:first-child
|
||||||
margin-right 6px
|
padding-left 22px
|
||||||
|
|
||||||
> [data-fa]:last-of-type
|
> [data-fa]:first-child
|
||||||
|
margin-right 6px
|
||||||
|
width 16px
|
||||||
|
|
||||||
|
> [data-fa]:last-child
|
||||||
display block
|
display block
|
||||||
position absolute
|
position absolute
|
||||||
top 0
|
top 0
|
||||||
@ -217,9 +233,25 @@ export default Vue.extend({
|
|||||||
&:active
|
&:active
|
||||||
background darken($theme-color, 10%)
|
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-enter-active,
|
||||||
.zoom-in-top-leave-active {
|
.zoom-in-top-leave-active {
|
||||||
transform-origin: center -16px;
|
transform-origin: center -16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.account[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.account:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -99,7 +99,7 @@ export default Vue.extend({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
.nav
|
root(isDark)
|
||||||
display inline-block
|
display inline-block
|
||||||
margin 0
|
margin 0
|
||||||
padding 0
|
padding 0
|
||||||
@ -131,7 +131,7 @@ export default Vue.extend({
|
|||||||
padding 0 24px
|
padding 0 24px
|
||||||
font-size 13px
|
font-size 13px
|
||||||
font-variant small-caps
|
font-variant small-caps
|
||||||
color #9eaba8
|
color isDark ? #b8c5ca : #9eaba8
|
||||||
text-decoration none
|
text-decoration none
|
||||||
transition none
|
transition none
|
||||||
cursor pointer
|
cursor pointer
|
||||||
@ -140,7 +140,7 @@ export default Vue.extend({
|
|||||||
pointer-events none
|
pointer-events none
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
color darken(#9eaba8, 20%)
|
color isDark ? #fff : darken(#9eaba8, 20%)
|
||||||
text-decoration none
|
text-decoration none
|
||||||
|
|
||||||
> [data-fa]:first-child
|
> [data-fa]:first-child
|
||||||
@ -164,4 +164,10 @@ export default Vue.extend({
|
|||||||
@media (max-width 700px)
|
@media (max-width 700px)
|
||||||
padding 0 12px
|
padding 0 12px
|
||||||
|
|
||||||
|
.nav[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.nav:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -84,7 +84,7 @@ export default Vue.extend({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
.notifications
|
root(isDark)
|
||||||
|
|
||||||
> button
|
> button
|
||||||
display block
|
display block
|
||||||
@ -101,10 +101,10 @@ export default Vue.extend({
|
|||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
&[data-active='true']
|
&[data-active='true']
|
||||||
color darken(#9eaba8, 20%)
|
color isDark ? #fff : darken(#9eaba8, 20%)
|
||||||
|
|
||||||
&:active
|
&:active
|
||||||
color darken(#9eaba8, 30%)
|
color isDark ? #fff : darken(#9eaba8, 30%)
|
||||||
|
|
||||||
> [data-fa].bell
|
> [data-fa].bell
|
||||||
font-size 1.2em
|
font-size 1.2em
|
||||||
@ -117,12 +117,13 @@ export default Vue.extend({
|
|||||||
color $theme-color
|
color $theme-color
|
||||||
|
|
||||||
> .pop
|
> .pop
|
||||||
|
$bgcolor = isDark ? #282c37 : #fff
|
||||||
display block
|
display block
|
||||||
position absolute
|
position absolute
|
||||||
top 56px
|
top 56px
|
||||||
right -72px
|
right -72px
|
||||||
width 300px
|
width 300px
|
||||||
background #fff
|
background $bgcolor
|
||||||
border-radius 4px
|
border-radius 4px
|
||||||
box-shadow 0 1px 4px rgba(0, 0, 0, 0.25)
|
box-shadow 0 1px 4px rgba(0, 0, 0, 0.25)
|
||||||
|
|
||||||
@ -147,7 +148,7 @@ export default Vue.extend({
|
|||||||
right 74px
|
right 74px
|
||||||
border-top solid 14px transparent
|
border-top solid 14px transparent
|
||||||
border-right solid 14px transparent
|
border-right solid 14px transparent
|
||||||
border-bottom solid 14px #fff
|
border-bottom solid 14px $bgcolor
|
||||||
border-left solid 14px transparent
|
border-left solid 14px transparent
|
||||||
|
|
||||||
> .mk-notifications
|
> .mk-notifications
|
||||||
@ -155,4 +156,10 @@ export default Vue.extend({
|
|||||||
font-size 1rem
|
font-size 1rem
|
||||||
overflow auto
|
overflow auto
|
||||||
|
|
||||||
|
.notifications[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.notifications:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -43,6 +43,8 @@ export default Vue.extend({
|
|||||||
XClock,
|
XClock,
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.$store.commit('setUiHeaderHeight', 48);
|
||||||
|
|
||||||
if ((this as any).os.isSignedIn) {
|
if ((this as any).os.isSignedIn) {
|
||||||
const ago = (new Date().getTime() - new Date((this as any).os.i.lastUsedAt).getTime()) / 1000
|
const ago = (new Date().getTime() - new Date((this as any).os.i.lastUsedAt).getTime()) / 1000
|
||||||
const isHisasiburi = ago >= 3600;
|
const isHisasiburi = ago >= 3600;
|
||||||
@ -169,10 +171,10 @@ root(isDark)
|
|||||||
> .mk-ui-header-search
|
> .mk-ui-header-search
|
||||||
display none
|
display none
|
||||||
|
|
||||||
.header[data-is-darkmode]
|
.header[data-darkmode]
|
||||||
root(true)
|
root(true)
|
||||||
|
|
||||||
.header
|
.header:not([data-darkmode])
|
||||||
root(false)
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<img :src="`${u.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
|
<img :src="`${u.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
|
||||||
</router-link>
|
</router-link>
|
||||||
<div class="title">
|
<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>
|
<p class="username">@{{ u | acct }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="description">{{ u.description }}</div>
|
<div class="description">{{ u.description }}</div>
|
||||||
@ -87,12 +87,12 @@ export default Vue.extend({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
.mk-user-preview
|
root(isDark)
|
||||||
position absolute
|
position absolute
|
||||||
z-index 2048
|
z-index 2048
|
||||||
margin-top -8px
|
margin-top -8px
|
||||||
width 250px
|
width 250px
|
||||||
background #fff
|
background isDark ? #282c37 : #fff
|
||||||
background-clip content-box
|
background-clip content-box
|
||||||
border solid 1px rgba(0, 0, 0, 0.1)
|
border solid 1px rgba(0, 0, 0, 0.1)
|
||||||
border-radius 4px
|
border-radius 4px
|
||||||
@ -101,7 +101,7 @@ export default Vue.extend({
|
|||||||
|
|
||||||
> .banner
|
> .banner
|
||||||
height 84px
|
height 84px
|
||||||
background-color #f5f5f5
|
background-color isDark ? #1c1e26 : #f5f5f5
|
||||||
background-size cover
|
background-size cover
|
||||||
background-position center
|
background-position center
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ export default Vue.extend({
|
|||||||
width 58px
|
width 58px
|
||||||
height 58px
|
height 58px
|
||||||
margin 0
|
margin 0
|
||||||
border solid 3px #fff
|
border solid 3px isDark ? #282c37 : #fff
|
||||||
border-radius 8px
|
border-radius 8px
|
||||||
|
|
||||||
> .title
|
> .title
|
||||||
@ -129,19 +129,19 @@ export default Vue.extend({
|
|||||||
margin 0
|
margin 0
|
||||||
font-weight bold
|
font-weight bold
|
||||||
line-height 16px
|
line-height 16px
|
||||||
color #656565
|
color isDark ? #fff : #656565
|
||||||
|
|
||||||
> .username
|
> .username
|
||||||
display block
|
display block
|
||||||
margin 0
|
margin 0
|
||||||
line-height 16px
|
line-height 16px
|
||||||
font-size 0.8em
|
font-size 0.8em
|
||||||
color #999
|
color isDark ? #606984 : #999
|
||||||
|
|
||||||
> .description
|
> .description
|
||||||
padding 0 16px
|
padding 0 16px
|
||||||
font-size 0.7em
|
font-size 0.7em
|
||||||
color #555
|
color isDark ? #9ea4ad : #555
|
||||||
|
|
||||||
> .status
|
> .status
|
||||||
padding 8px 16px
|
padding 8px 16px
|
||||||
@ -164,4 +164,10 @@ export default Vue.extend({
|
|||||||
top 92px
|
top 92px
|
||||||
right 8px
|
right 8px
|
||||||
|
|
||||||
|
.mk-user-preview[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mk-user-preview:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -34,8 +34,8 @@ export default Vue.extend({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.mk-widget-container
|
root(isDark)
|
||||||
background #fff
|
background isDark ? #282C37 : #fff
|
||||||
border solid 1px rgba(0, 0, 0, 0.075)
|
border solid 1px rgba(0, 0, 0, 0.075)
|
||||||
border-radius 6px
|
border-radius 6px
|
||||||
overflow hidden
|
overflow hidden
|
||||||
@ -45,6 +45,8 @@ export default Vue.extend({
|
|||||||
border none !important
|
border none !important
|
||||||
|
|
||||||
> header
|
> header
|
||||||
|
background isDark ? #313543 : #fff
|
||||||
|
|
||||||
> .title
|
> .title
|
||||||
z-index 1
|
z-index 1
|
||||||
margin 0
|
margin 0
|
||||||
@ -52,7 +54,7 @@ export default Vue.extend({
|
|||||||
line-height 42px
|
line-height 42px
|
||||||
font-size 0.9em
|
font-size 0.9em
|
||||||
font-weight bold
|
font-weight bold
|
||||||
color #888
|
color isDark ? #e3e5e8 : #888
|
||||||
box-shadow 0 1px rgba(0, 0, 0, 0.07)
|
box-shadow 0 1px rgba(0, 0, 0, 0.07)
|
||||||
|
|
||||||
> [data-fa]
|
> [data-fa]
|
||||||
@ -70,16 +72,23 @@ export default Vue.extend({
|
|||||||
width 42px
|
width 42px
|
||||||
font-size 0.9em
|
font-size 0.9em
|
||||||
line-height 42px
|
line-height 42px
|
||||||
color #ccc
|
color isDark ? #9baec8 : #ccc
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
color #aaa
|
color isDark ? #b2c1d5 : #aaa
|
||||||
|
|
||||||
&:active
|
&:active
|
||||||
color #999
|
color isDark ? #b2c1d5 : #999
|
||||||
|
|
||||||
&.withGradient
|
&.withGradient
|
||||||
> .title
|
> .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)
|
box-shadow 0 1px rgba(#000, 0.11)
|
||||||
|
|
||||||
|
.mk-widget-container[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mk-widget-container:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -465,7 +465,7 @@ export default Vue.extend({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
.mk-window
|
root(isDark)
|
||||||
display block
|
display block
|
||||||
|
|
||||||
> .bg
|
> .bg
|
||||||
@ -559,7 +559,7 @@ export default Vue.extend({
|
|||||||
> .body
|
> .body
|
||||||
height 100%
|
height 100%
|
||||||
overflow hidden
|
overflow hidden
|
||||||
background #fff
|
background isDark ? #282C37 : #fff
|
||||||
border-radius 6px
|
border-radius 6px
|
||||||
box-shadow 0 2px 6px 0 rgba(0, 0, 0, 0.2)
|
box-shadow 0 2px 6px 0 rgba(0, 0, 0, 0.2)
|
||||||
|
|
||||||
@ -571,12 +571,12 @@ export default Vue.extend({
|
|||||||
overflow hidden
|
overflow hidden
|
||||||
white-space nowrap
|
white-space nowrap
|
||||||
cursor move
|
cursor move
|
||||||
background #fff
|
background isDark ? #313543 : #fff
|
||||||
border-radius 6px 6px 0 0
|
border-radius 6px 6px 0 0
|
||||||
box-shadow 0 1px 0 rgba(#000, 0.1)
|
box-shadow 0 1px 0 rgba(#000, 0.1)
|
||||||
|
|
||||||
&.withGradient
|
&.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)
|
box-shadow 0 1px 0 rgba(#000, 0.15)
|
||||||
|
|
||||||
&, *
|
&, *
|
||||||
@ -593,7 +593,7 @@ export default Vue.extend({
|
|||||||
font-size 1em
|
font-size 1em
|
||||||
line-height $header-height
|
line-height $header-height
|
||||||
font-weight normal
|
font-weight normal
|
||||||
color #666
|
color isDark ? #e3e5e8 : #666
|
||||||
|
|
||||||
> div:last-child
|
> div:last-child
|
||||||
position absolute
|
position absolute
|
||||||
@ -608,16 +608,16 @@ export default Vue.extend({
|
|||||||
padding 0
|
padding 0
|
||||||
cursor pointer
|
cursor pointer
|
||||||
font-size 1em
|
font-size 1em
|
||||||
color rgba(#000, 0.4)
|
color isDark ? #9baec8 : rgba(#000, 0.4)
|
||||||
border none
|
border none
|
||||||
outline none
|
outline none
|
||||||
background transparent
|
background transparent
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
color rgba(#000, 0.6)
|
color isDark ? #b2c1d5 : rgba(#000, 0.6)
|
||||||
|
|
||||||
&:active
|
&:active
|
||||||
color darken(#000, 30%)
|
color isDark ? #b2c1d5 : darken(#000, 30%)
|
||||||
|
|
||||||
> [data-fa]
|
> [data-fa]
|
||||||
padding 0
|
padding 0
|
||||||
@ -632,4 +632,10 @@ export default Vue.extend({
|
|||||||
> .main > .body > .content
|
> .main > .body > .content
|
||||||
height calc(100% - 40px)
|
height calc(100% - 40px)
|
||||||
|
|
||||||
|
.mk-window[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mk-window:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
73
src/client/app/desktop/views/pages/favorites.vue
Normal file
73
src/client/app/desktop/views/pages/favorites.vue
Normal 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>
|
@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="header" :data-is-dark-background="user.bannerUrl != null">
|
<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="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-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>
|
<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
|
background #f7f7f7
|
||||||
box-shadow 0 1px 1px rgba(0, 0, 0, 0.075)
|
box-shadow 0 1px 1px rgba(0, 0, 0, 0.075)
|
||||||
|
|
||||||
|
> .is-suspended
|
||||||
> .is-remote
|
> .is-remote
|
||||||
padding 16px
|
&.is-suspended
|
||||||
color #573c08
|
color #570808
|
||||||
background #fff0db
|
background #ffdbdb
|
||||||
|
|
||||||
|
&.is-remote
|
||||||
|
color #573c08
|
||||||
|
background #fff0db
|
||||||
|
|
||||||
> p
|
> p
|
||||||
margin 0 auto
|
margin 0 auto
|
||||||
max-width 1024px
|
padding 14px 16px
|
||||||
|
max-width 1200px
|
||||||
|
font-size 14px
|
||||||
|
|
||||||
> a
|
> a
|
||||||
font-weight bold
|
font-weight bold
|
||||||
|
@ -1,13 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mkw-messaging">
|
<div class="mkw-messaging">
|
||||||
<p class="title" v-if="props.design == 0">%fa:comments%%i18n:@title%</p>
|
<mk-widget-container :show-header="props.design == 0">
|
||||||
<mk-messaging ref="index" compact @navigate="navigate"/>
|
<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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import define from '../../../common/define-widget';
|
import define from '../../../common/define-widget';
|
||||||
import MkMessagingRoomWindow from '../components/messaging-room-window.vue';
|
import MkMessagingRoomWindow from '../components/messaging-room-window.vue';
|
||||||
|
import MkMessagingWindow from '../components/messaging-window.vue';
|
||||||
|
|
||||||
export default define({
|
export default define({
|
||||||
name: 'messaging',
|
name: 'messaging',
|
||||||
@ -21,6 +26,9 @@ export default define({
|
|||||||
user: user
|
user: user
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
add() {
|
||||||
|
(this as any).os.new(MkMessagingWindow);
|
||||||
|
},
|
||||||
func() {
|
func() {
|
||||||
if (this.props.design == 1) {
|
if (this.props.design == 1) {
|
||||||
this.props.design = 0;
|
this.props.design = 0;
|
||||||
@ -34,25 +42,7 @@ export default define({
|
|||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.mkw-messaging
|
.mkw-messaging
|
||||||
overflow hidden
|
.mk-messaging
|
||||||
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
|
|
||||||
max-height 250px
|
max-height 250px
|
||||||
overflow auto
|
overflow auto
|
||||||
|
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mkw-notifications">
|
<div class="mkw-notifications">
|
||||||
<template v-if="!props.compact">
|
<mk-widget-container :show-header="!props.compact">
|
||||||
<p class="title">%fa:R bell%%i18n:@title%</p>
|
<template slot="header">%fa:R bell%%i18n:@title%</template>
|
||||||
<button @click="settings" title="%i18n:@settings%">%fa:cog%</button>
|
<button slot="func" title="%i18n:@settings%" @click="settings">%fa:cog%</button>
|
||||||
</template>
|
|
||||||
<mk-notifications/>
|
<mk-notifications :class="$style.notifications"/>
|
||||||
|
</mk-widget-container>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -27,44 +28,9 @@ export default define({
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" module>
|
||||||
.mkw-notifications
|
.notifications
|
||||||
background #fff
|
max-height 300px
|
||||||
border solid 1px rgba(0, 0, 0, 0.075)
|
overflow auto
|
||||||
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>
|
</style>
|
||||||
|
@ -1,16 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mkw-polls">
|
<div class="mkw-polls">
|
||||||
<template v-if="!props.compact">
|
<mk-widget-container :show-header="!props.compact">
|
||||||
<p class="title">%fa:chart-pie%%i18n:@title%</p>
|
<template slot="header">%fa:chart-pie%%i18n:@title%</template>
|
||||||
<button @click="fetch" title="%i18n:@refresh%">%fa:sync%</button>
|
<button slot="func" title="%i18n:@refresh%" @click="fetch">%fa:sync%</button>
|
||||||
</template>
|
|
||||||
<div class="poll" v-if="!fetching && poll != null">
|
<div class="mkw-polls--body" :data-darkmode="_darkmode_">
|
||||||
<p v-if="poll.text"><router-link to="poll | notePage">{{ poll.text }}</router-link></p>
|
<div class="poll" v-if="!fetching && poll != null">
|
||||||
<p v-if="!poll.text"><router-link to="poll | notePage">%fa:link%</router-link></p>
|
<p v-if="poll.text"><router-link to="poll | notePage">{{ poll.text }}</router-link></p>
|
||||||
<mk-poll :note="poll"/>
|
<p v-if="!poll.text"><router-link to="poll | notePage">%fa:link%</router-link></p>
|
||||||
</div>
|
<mk-poll :note="poll"/>
|
||||||
<p class="empty" v-if="!fetching && poll == null">%i18n:@nothing%</p>
|
</div>
|
||||||
<p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
|
<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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -60,44 +63,11 @@ export default define({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.mkw-polls
|
root(isDark)
|
||||||
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
|
|
||||||
|
|
||||||
> .poll
|
> .poll
|
||||||
padding 16px
|
padding 16px
|
||||||
font-size 12px
|
font-size 12px
|
||||||
color #555
|
color isDark ? #9ea4ad : #555
|
||||||
|
|
||||||
> p
|
> p
|
||||||
margin 0 0 8px 0
|
margin 0 0 8px 0
|
||||||
@ -120,4 +90,10 @@ export default define({
|
|||||||
> [data-fa]
|
> [data-fa]
|
||||||
margin-right 4px
|
margin-right 4px
|
||||||
|
|
||||||
|
.mkw-polls--body[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mkw-polls--body:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -42,9 +42,9 @@ export default define({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.mkw-profile
|
root(isDark)
|
||||||
overflow hidden
|
overflow hidden
|
||||||
background #fff
|
background isDark ? #282c37 : #fff
|
||||||
border solid 1px rgba(0, 0, 0, 0.075)
|
border solid 1px rgba(0, 0, 0, 0.075)
|
||||||
border-radius 6px
|
border-radius 6px
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ export default define({
|
|||||||
|
|
||||||
> .banner
|
> .banner
|
||||||
height 100px
|
height 100px
|
||||||
background-color #f5f5f5
|
background-color isDark ? #303e4a : #f5f5f5
|
||||||
background-size cover
|
background-size cover
|
||||||
background-position center
|
background-position center
|
||||||
cursor pointer
|
cursor pointer
|
||||||
@ -104,7 +104,7 @@ export default define({
|
|||||||
width 58px
|
width 58px
|
||||||
height 58px
|
height 58px
|
||||||
margin 0
|
margin 0
|
||||||
border solid 3px #fff
|
border solid 3px isDark ? #282c37 : #fff
|
||||||
border-radius 8px
|
border-radius 8px
|
||||||
vertical-align bottom
|
vertical-align bottom
|
||||||
cursor pointer
|
cursor pointer
|
||||||
@ -114,13 +114,19 @@ export default define({
|
|||||||
margin 10px 0 0 84px
|
margin 10px 0 0 84px
|
||||||
line-height 16px
|
line-height 16px
|
||||||
font-weight bold
|
font-weight bold
|
||||||
color #555
|
color isDark ? #fff : #555
|
||||||
|
|
||||||
> .username
|
> .username
|
||||||
display block
|
display block
|
||||||
margin 4px 0 8px 84px
|
margin 4px 0 8px 84px
|
||||||
line-height 16px
|
line-height 16px
|
||||||
font-size 0.9em
|
font-size 0.9em
|
||||||
color #999
|
color isDark ? #606984 : #999
|
||||||
|
|
||||||
|
.mkw-profile[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.mkw-profile:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,15 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mkw-trends">
|
<div class="mkw-trends">
|
||||||
<template v-if="!props.compact">
|
<mk-widget-container :show-header="!props.compact">
|
||||||
<p class="title">%fa:fire%%i18n:@title%</p>
|
<template slot="header">%fa:fire%%i18n:@title%</template>
|
||||||
<button @click="fetch" title="%i18n:@refresh%">%fa:sync%</button>
|
<button slot="func" title="%i18n:@refresh%" @click="fetch">%fa:sync%</button>
|
||||||
</template>
|
|
||||||
<p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
|
<div class="mkw-trends--body">
|
||||||
<div class="note" v-else-if="note != null">
|
<p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
|
||||||
<p class="text"><router-link :to="note | notePage">{{ note.text }}</router-link></p>
|
<div class="note" v-else-if="note != null">
|
||||||
<p class="author">―<router-link :to="note.user | userPage">@{{ note.user | acct }}</router-link></p>
|
<p class="text"><router-link :to="note | notePage">{{ note.text }}</router-link></p>
|
||||||
</div>
|
<p class="author">―<router-link :to="note.user | userPage">@{{ note.user | acct }}</router-link></p>
|
||||||
<p class="empty" v-else>%i18n:@nothing%</p>
|
</div>
|
||||||
|
<p class="empty" v-else>%i18n:@nothing%</p>
|
||||||
|
</div>
|
||||||
|
</mk-widget-container>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -63,67 +66,41 @@ export default define({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.mkw-trends
|
root(isDark)
|
||||||
background #fff
|
.mkw-trends--body
|
||||||
border solid 1px rgba(0, 0, 0, 0.075)
|
> .note
|
||||||
border-radius 6px
|
padding 16px
|
||||||
|
font-size 12px
|
||||||
|
font-style oblique
|
||||||
|
color #555
|
||||||
|
|
||||||
> .title
|
> p
|
||||||
margin 0
|
margin 0
|
||||||
padding 0 16px
|
|
||||||
line-height 42px
|
|
||||||
font-size 0.9em
|
|
||||||
font-weight bold
|
|
||||||
color #888
|
|
||||||
border-bottom solid 1px #eee
|
|
||||||
|
|
||||||
> [data-fa]
|
> .text,
|
||||||
margin-right 4px
|
> .author
|
||||||
|
> a
|
||||||
|
color inherit
|
||||||
|
|
||||||
> button
|
> .empty
|
||||||
position absolute
|
margin 0
|
||||||
z-index 2
|
padding 16px
|
||||||
top 0
|
text-align center
|
||||||
right 0
|
|
||||||
padding 0
|
|
||||||
width 42px
|
|
||||||
font-size 0.9em
|
|
||||||
line-height 42px
|
|
||||||
color #ccc
|
|
||||||
|
|
||||||
&:hover
|
|
||||||
color #aaa
|
color #aaa
|
||||||
|
|
||||||
&:active
|
> .fetching
|
||||||
color #999
|
|
||||||
|
|
||||||
> .note
|
|
||||||
padding 16px
|
|
||||||
font-size 12px
|
|
||||||
font-style oblique
|
|
||||||
color #555
|
|
||||||
|
|
||||||
> p
|
|
||||||
margin 0
|
margin 0
|
||||||
|
padding 16px
|
||||||
|
text-align center
|
||||||
|
color #aaa
|
||||||
|
|
||||||
> .text,
|
> [data-fa]
|
||||||
> .author
|
margin-right 4px
|
||||||
> a
|
|
||||||
color inherit
|
|
||||||
|
|
||||||
> .empty
|
.mkw-trends[data-darkmode]
|
||||||
margin 0
|
root(true)
|
||||||
padding 16px
|
|
||||||
text-align center
|
|
||||||
color #aaa
|
|
||||||
|
|
||||||
> .fetching
|
.mkw-trends:not([data-darkmode])
|
||||||
margin 0
|
root(false)
|
||||||
padding 16px
|
|
||||||
text-align center
|
|
||||||
color #aaa
|
|
||||||
|
|
||||||
> [data-fa]
|
|
||||||
margin-right 4px
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,23 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mkw-users">
|
<div class="mkw-users">
|
||||||
<template v-if="!props.compact">
|
<mk-widget-container :show-header="!props.compact">
|
||||||
<p class="title">%fa:users%%i18n:@title%</p>
|
<template slot="header">%fa:users%%i18n:@title%</template>
|
||||||
<button @click="refresh" title="%i18n:@refresh%">%fa:sync%</button>
|
<button slot="func" title="%i18n:@refresh%" @click="refresh">%fa:sync%</button>
|
||||||
</template>
|
|
||||||
<p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
|
<div class="mkw-users--body">
|
||||||
<template v-else-if="users.length != 0">
|
<p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
|
||||||
<div class="user" v-for="_user in users">
|
<template v-else-if="users.length != 0">
|
||||||
<router-link class="avatar-anchor" :to="_user | userPage">
|
<div class="user" v-for="_user in users">
|
||||||
<img class="avatar" :src="`${_user.avatarUrl}?thumbnail&size=42`" alt="" v-user-preview="_user.id"/>
|
<router-link class="avatar-anchor" :to="_user | userPage">
|
||||||
</router-link>
|
<img class="avatar" :src="`${_user.avatarUrl}?thumbnail&size=42`" alt="" v-user-preview="_user.id"/>
|
||||||
<div class="body">
|
</router-link>
|
||||||
<router-link class="name" :to="_user | userPage" v-user-preview="_user.id">{{ _user | userName }}</router-link>
|
<div class="body">
|
||||||
<p class="username">@{{ _user | acct }}</p>
|
<router-link class="name" :to="_user | userPage" v-user-preview="_user.id">{{ _user | userName }}</router-link>
|
||||||
</div>
|
<p class="username">@{{ _user | acct }}</p>
|
||||||
<mk-follow-button :user="_user"/>
|
</div>
|
||||||
|
<mk-follow-button :user="_user"/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<p class="empty" v-else>%i18n:@no-one%</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</mk-widget-container>
|
||||||
<p class="empty" v-else>%i18n:@no-one%</p>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -71,100 +74,74 @@ export default define({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.mkw-users
|
root(isDark)
|
||||||
background #fff
|
.mkw-users--body
|
||||||
border solid 1px rgba(0, 0, 0, 0.075)
|
> .user
|
||||||
border-radius 6px
|
padding 16px
|
||||||
|
border-bottom solid 1px isDark ? #1c2023 : #eee
|
||||||
|
|
||||||
> .title
|
&:last-child
|
||||||
margin 0
|
border-bottom none
|
||||||
padding 0 16px
|
|
||||||
line-height 42px
|
|
||||||
font-size 0.9em
|
|
||||||
font-weight bold
|
|
||||||
color #888
|
|
||||||
border-bottom solid 1px #eee
|
|
||||||
|
|
||||||
> [data-fa]
|
&:after
|
||||||
margin-right 4px
|
content ""
|
||||||
|
display block
|
||||||
|
clear both
|
||||||
|
|
||||||
> button
|
> .avatar-anchor
|
||||||
position absolute
|
display block
|
||||||
z-index 2
|
float left
|
||||||
top 0
|
margin 0 12px 0 0
|
||||||
right 0
|
|
||||||
padding 0
|
|
||||||
width 42px
|
|
||||||
font-size 0.9em
|
|
||||||
line-height 42px
|
|
||||||
color #ccc
|
|
||||||
|
|
||||||
&: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
|
color #aaa
|
||||||
|
|
||||||
&:active
|
> .fetching
|
||||||
color #999
|
margin 0
|
||||||
|
padding 16px
|
||||||
|
text-align center
|
||||||
|
color #aaa
|
||||||
|
|
||||||
> .user
|
> [data-fa]
|
||||||
padding 16px
|
margin-right 4px
|
||||||
border-bottom solid 1px #eee
|
|
||||||
|
|
||||||
&:last-child
|
.mkw-users[data-darkmode]
|
||||||
border-bottom none
|
root(true)
|
||||||
|
|
||||||
&:after
|
.mkw-users:not([data-darkmode])
|
||||||
content ""
|
root(false)
|
||||||
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
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -56,6 +56,13 @@ body > noscript {
|
|||||||
animation-delay: 0.32s;
|
animation-delay: 0.32s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html[data-darkmode] #ini {
|
||||||
|
background: #191b22;
|
||||||
|
}
|
||||||
|
html[data-darkmode] #ini > p {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes ini {
|
@keyframes ini {
|
||||||
0%, 80%, 100% {
|
0%, 80%, 100% {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
|
import Vuex from 'vuex';
|
||||||
import VueRouter from 'vue-router';
|
import VueRouter from 'vue-router';
|
||||||
import VModal from 'vue-js-modal';
|
import VModal from 'vue-js-modal';
|
||||||
import * as TreeView from 'vue-json-tree-view';
|
import * as TreeView from 'vue-json-tree-view';
|
||||||
@ -23,6 +24,7 @@ switch (lang) {
|
|||||||
default: elementLocale = ElementLocaleEn; break;
|
default: elementLocale = ElementLocaleEn; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vue.use(Vuex);
|
||||||
Vue.use(VueRouter);
|
Vue.use(VueRouter);
|
||||||
Vue.use(VModal);
|
Vue.use(VModal);
|
||||||
Vue.use(TreeView);
|
Vue.use(TreeView);
|
||||||
@ -39,6 +41,17 @@ require('./common/views/widgets');
|
|||||||
// Register global filters
|
// Register global filters
|
||||||
require('./common/views/filters');
|
require('./common/views/filters');
|
||||||
|
|
||||||
|
const store = new Vuex.Store({
|
||||||
|
state: {
|
||||||
|
uiHeaderHeight: 0
|
||||||
|
},
|
||||||
|
mutations: {
|
||||||
|
setUiHeaderHeight(state, height) {
|
||||||
|
state.uiHeaderHeight = height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Vue.mixin({
|
Vue.mixin({
|
||||||
destroyed(this: any) {
|
destroyed(this: any) {
|
||||||
if (this.$el.parentNode) {
|
if (this.$el.parentNode) {
|
||||||
@ -47,6 +60,48 @@ Vue.mixin({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Dark/Light
|
||||||
|
const bus = new Vue();
|
||||||
|
Vue.mixin({
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
_darkmode_: localStorage.getItem('darkmode') == 'true'
|
||||||
|
};
|
||||||
|
},
|
||||||
|
beforeCreate() {
|
||||||
|
// なぜか警告が出るので
|
||||||
|
this._darkmode_ = localStorage.getItem('darkmode') == 'true';
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
bus.$off('updated', this._onDarkmodeUpdated_);
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this._onDarkmodeUpdated_(this._darkmode_);
|
||||||
|
bus.$on('updated', this._onDarkmodeUpdated_);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
_updateDarkmode_(v) {
|
||||||
|
localStorage.setItem('darkmode', v.toString());
|
||||||
|
bus.$emit('updated', v);
|
||||||
|
if (v) {
|
||||||
|
document.documentElement.setAttribute('data-darkmode', 'true');
|
||||||
|
} else {
|
||||||
|
document.documentElement.removeAttribute('data-darkmode');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_onDarkmodeUpdated_(v) {
|
||||||
|
if (!this.$el || !this.$el.setAttribute) return;
|
||||||
|
if (v) {
|
||||||
|
this.$el.setAttribute('data-darkmode', 'true');
|
||||||
|
} else {
|
||||||
|
this.$el.removeAttribute('data-darkmode');
|
||||||
|
}
|
||||||
|
this._darkmode_ = v;
|
||||||
|
this.$forceUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APP ENTRY POINT!
|
* APP ENTRY POINT!
|
||||||
*/
|
*/
|
||||||
@ -108,6 +163,7 @@ export default (callback: (launch: (router: VueRouter, api?: (os: MiOS) => API)
|
|||||||
});
|
});
|
||||||
|
|
||||||
const app = new Vue({
|
const app = new Vue({
|
||||||
|
store,
|
||||||
router,
|
router,
|
||||||
created() {
|
created() {
|
||||||
this.$watch('os.i', i => {
|
this.$watch('os.i', i => {
|
||||||
|
@ -93,6 +93,8 @@ export default Vue.extend({
|
|||||||
color #b2b8bb
|
color #b2b8bb
|
||||||
|
|
||||||
> .body
|
> .body
|
||||||
|
max-height 128px
|
||||||
|
overflow hidden
|
||||||
|
|
||||||
> .text
|
> .text
|
||||||
cursor default
|
cursor default
|
||||||
|
@ -4,15 +4,13 @@
|
|||||||
<x-sub :note="p.reply"/>
|
<x-sub :note="p.reply"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="renote" v-if="isRenote">
|
<div class="renote" v-if="isRenote">
|
||||||
<p>
|
<router-link class="avatar-anchor" :to="note.user | userPage">
|
||||||
<router-link class="avatar-anchor" :to="note.user | userPage">
|
<img class="avatar" :src="`${note.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
|
||||||
<img class="avatar" :src="`${note.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
|
</router-link>
|
||||||
</router-link>
|
%fa:retweet%
|
||||||
%fa:retweet%
|
<span>{{ '%i18n:!@reposted-by%'.substr(0, '%i18n:!@reposted-by%'.indexOf('{')) }}</span>
|
||||||
<span>{{ '%i18n:!@reposted-by%'.substr(0, '%i18n:!@reposted-by%'.indexOf('{')) }}</span>
|
<router-link class="name" :to="note.user | userPage">{{ note.user | userName }}</router-link>
|
||||||
<router-link class="name" :to="note.user | userPage">{{ note.user | userName }}</router-link>
|
<span>{{ '%i18n:!@reposted-by%'.substr('%i18n:!@reposted-by%'.indexOf('}') + 1) }}</span>
|
||||||
<span>{{ '%i18n:!@reposted-by%'.substr('%i18n:!@reposted-by%'.indexOf('}') + 1) }}</span>
|
|
||||||
</p>
|
|
||||||
<mk-time :time="note.createdAt"/>
|
<mk-time :time="note.createdAt"/>
|
||||||
</div>
|
</div>
|
||||||
<article>
|
<article>
|
||||||
@ -33,27 +31,33 @@
|
|||||||
</header>
|
</header>
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<p class="channel" v-if="p.channel != null"><a target="_blank">{{ p.channel.title }}</a>:</p>
|
<p class="channel" v-if="p.channel != null"><a target="_blank">{{ p.channel.title }}</a>:</p>
|
||||||
<div class="text">
|
<p v-if="p.cw != null" class="cw">
|
||||||
<a class="reply" v-if="p.reply">
|
<span class="text" v-if="p.cw != ''">{{ p.cw }}</span>
|
||||||
%fa:reply%
|
<span class="toggle" @click="showContent = !showContent">{{ showContent ? '隠す' : 'もっと見る' }}</span>
|
||||||
</a>
|
</p>
|
||||||
<mk-note-html v-if="p.text" :text="p.text" :i="os.i" :class="$style.text"/>
|
<div class="content" v-show="p.cw == null || showContent">
|
||||||
<a class="rp" v-if="p.renote != null">RP:</a>
|
<div class="text">
|
||||||
|
<a class="reply" v-if="p.reply">
|
||||||
|
%fa:reply%
|
||||||
|
</a>
|
||||||
|
<mk-note-html v-if="p.text" :text="p.text" :i="os.i" :class="$style.text"/>
|
||||||
|
<a class="rp" v-if="p.renote != null">RP:</a>
|
||||||
|
</div>
|
||||||
|
<div class="media" v-if="p.media.length > 0">
|
||||||
|
<mk-media-list :media-list="p.media"/>
|
||||||
|
</div>
|
||||||
|
<mk-poll v-if="p.poll" :note="p" ref="pollViewer"/>
|
||||||
|
<div class="tags" v-if="p.tags && p.tags.length > 0">
|
||||||
|
<router-link v-for="tag in p.tags" :key="tag" :to="`/search?q=#${tag}`">{{ tag }}</router-link>
|
||||||
|
</div>
|
||||||
|
<mk-url-preview v-for="url in urls" :url="url" :key="url"/>
|
||||||
|
<a class="location" v-if="p.geo" :href="`http://maps.google.com/maps?q=${p.geo.coordinates[1]},${p.geo.coordinates[0]}`" target="_blank">%fa:map-marker-alt% 位置情報</a>
|
||||||
|
<div class="map" v-if="p.geo" ref="map"></div>
|
||||||
|
<div class="renote" v-if="p.renote">
|
||||||
|
<mk-note-preview :note="p.renote"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="media" v-if="p.media.length > 0">
|
|
||||||
<mk-media-list :media-list="p.media"/>
|
|
||||||
</div>
|
|
||||||
<mk-poll v-if="p.poll" :note="p" ref="pollViewer"/>
|
|
||||||
<div class="tags" v-if="p.tags && p.tags.length > 0">
|
|
||||||
<router-link v-for="tag in p.tags" :key="tag" :to="`/search?q=#${tag}`">{{ tag }}</router-link>
|
|
||||||
</div>
|
|
||||||
<mk-url-preview v-for="url in urls" :url="url" :key="url"/>
|
|
||||||
<a class="location" v-if="p.geo" :href="`http://maps.google.com/maps?q=${p.geo.coordinates[1]},${p.geo.coordinates[0]}`" target="_blank">%fa:map-marker-alt% 位置情報</a>
|
|
||||||
<div class="map" v-if="p.geo" ref="map"></div>
|
|
||||||
<span class="app" v-if="p.app">via <b>{{ p.app.name }}</b></span>
|
<span class="app" v-if="p.app">via <b>{{ p.app.name }}</b></span>
|
||||||
<div class="renote" v-if="p.renote">
|
|
||||||
<mk-note-preview :note="p.renote"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<footer>
|
<footer>
|
||||||
<mk-reactions-viewer :note="p" ref="reactionsViewer"/>
|
<mk-reactions-viewer :note="p" ref="reactionsViewer"/>
|
||||||
@ -94,6 +98,7 @@ export default Vue.extend({
|
|||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
showContent: false,
|
||||||
connection: null,
|
connection: null,
|
||||||
connectionId: null
|
connectionId: null
|
||||||
};
|
};
|
||||||
@ -231,7 +236,7 @@ export default Vue.extend({
|
|||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
@import '~const.styl'
|
@import '~const.styl'
|
||||||
|
|
||||||
.note
|
root(isDark)
|
||||||
font-size 12px
|
font-size 12px
|
||||||
border-bottom solid 1px #eaeaea
|
border-bottom solid 1px #eaeaea
|
||||||
|
|
||||||
@ -251,42 +256,47 @@ export default Vue.extend({
|
|||||||
font-size 16px
|
font-size 16px
|
||||||
|
|
||||||
> .renote
|
> .renote
|
||||||
|
display flex
|
||||||
|
align-items baseline
|
||||||
|
padding 8px 16px
|
||||||
|
line-height 28px
|
||||||
color #9dbb00
|
color #9dbb00
|
||||||
background linear-gradient(to bottom, #edfde2 0%, #fff 100%)
|
background linear-gradient(to bottom, #edfde2 0%, #fff 100%)
|
||||||
|
|
||||||
> p
|
@media (min-width 500px)
|
||||||
margin 0
|
padding 16px
|
||||||
padding 8px 16px
|
|
||||||
line-height 28px
|
|
||||||
|
|
||||||
@media (min-width 500px)
|
.avatar-anchor
|
||||||
padding 16px
|
display inline-block
|
||||||
|
|
||||||
.avatar-anchor
|
.avatar
|
||||||
display inline-block
|
vertical-align bottom
|
||||||
|
width 28px
|
||||||
|
height 28px
|
||||||
|
margin 0 8px 0 0
|
||||||
|
border-radius 6px
|
||||||
|
|
||||||
.avatar
|
[data-fa]
|
||||||
vertical-align bottom
|
margin-right 4px
|
||||||
width 28px
|
|
||||||
height 28px
|
|
||||||
margin 0 8px 0 0
|
|
||||||
border-radius 6px
|
|
||||||
|
|
||||||
[data-fa]
|
> span
|
||||||
margin-right 4px
|
flex-shrink 0
|
||||||
|
|
||||||
.name
|
&:last-of-type
|
||||||
font-weight bold
|
margin-right 8px
|
||||||
|
|
||||||
|
.name
|
||||||
|
overflow hidden
|
||||||
|
flex-shrink 1
|
||||||
|
text-overflow ellipsis
|
||||||
|
white-space nowrap
|
||||||
|
font-weight bold
|
||||||
|
|
||||||
> .mk-time
|
> .mk-time
|
||||||
position absolute
|
display block
|
||||||
top 8px
|
margin-left auto
|
||||||
right 16px
|
flex-shrink 0
|
||||||
font-size 0.9em
|
font-size 0.9em
|
||||||
line-height 28px
|
|
||||||
|
|
||||||
@media (min-width 500px)
|
|
||||||
top 16px
|
|
||||||
|
|
||||||
& + article
|
& + article
|
||||||
padding-top 8px
|
padding-top 8px
|
||||||
@ -368,6 +378,8 @@ export default Vue.extend({
|
|||||||
|
|
||||||
> .username
|
> .username
|
||||||
margin 0 0.5em 0 0
|
margin 0 0.5em 0 0
|
||||||
|
overflow hidden
|
||||||
|
text-overflow ellipsis
|
||||||
color #ccc
|
color #ccc
|
||||||
|
|
||||||
> .info
|
> .info
|
||||||
@ -383,101 +395,140 @@ export default Vue.extend({
|
|||||||
|
|
||||||
> .body
|
> .body
|
||||||
|
|
||||||
> .text
|
> .cw
|
||||||
|
cursor default
|
||||||
display block
|
display block
|
||||||
margin 0
|
margin 0
|
||||||
padding 0
|
padding 0
|
||||||
overflow-wrap break-word
|
overflow-wrap break-word
|
||||||
font-size 1.1em
|
font-size 1.1em
|
||||||
color #717171
|
color isDark ? #fff : #717171
|
||||||
|
|
||||||
>>> .quote
|
> .text
|
||||||
margin 8px
|
|
||||||
padding 6px 12px
|
|
||||||
color #aaa
|
|
||||||
border-left solid 3px #eee
|
|
||||||
|
|
||||||
> .reply
|
|
||||||
margin-right 8px
|
margin-right 8px
|
||||||
|
|
||||||
|
> .toggle
|
||||||
|
display inline-block
|
||||||
|
padding 4px 8px
|
||||||
|
font-size 0.7em
|
||||||
|
color isDark ? #393f4f : #fff
|
||||||
|
background isDark ? #687390 : #b1b9c1
|
||||||
|
border-radius 2px
|
||||||
|
cursor pointer
|
||||||
|
user-select none
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
background isDark ? #707b97 : #bbc4ce
|
||||||
|
|
||||||
|
> .content
|
||||||
|
|
||||||
|
> .text
|
||||||
|
display block
|
||||||
|
margin 0
|
||||||
|
padding 0
|
||||||
|
overflow-wrap break-word
|
||||||
|
font-size 1.1em
|
||||||
color #717171
|
color #717171
|
||||||
|
|
||||||
> .rp
|
>>> .title
|
||||||
margin-left 4px
|
|
||||||
font-style oblique
|
|
||||||
color #a0bf46
|
|
||||||
|
|
||||||
[data-is-me]:after
|
|
||||||
content "you"
|
|
||||||
padding 0 4px
|
|
||||||
margin-left 4px
|
|
||||||
font-size 80%
|
|
||||||
color $theme-color-foreground
|
|
||||||
background $theme-color
|
|
||||||
border-radius 4px
|
|
||||||
|
|
||||||
.mk-url-preview
|
|
||||||
margin-top 8px
|
|
||||||
|
|
||||||
> .channel
|
|
||||||
margin 0
|
|
||||||
|
|
||||||
> .tags
|
|
||||||
margin 4px 0 0 0
|
|
||||||
|
|
||||||
> *
|
|
||||||
display inline-block
|
|
||||||
margin 0 8px 0 0
|
|
||||||
padding 2px 8px 2px 16px
|
|
||||||
font-size 90%
|
|
||||||
color #8d969e
|
|
||||||
background #edf0f3
|
|
||||||
border-radius 4px
|
|
||||||
|
|
||||||
&:before
|
|
||||||
content ""
|
|
||||||
display block
|
display block
|
||||||
position absolute
|
margin-bottom 4px
|
||||||
top 0
|
padding 4px
|
||||||
bottom 0
|
font-size 90%
|
||||||
left 4px
|
text-align center
|
||||||
width 8px
|
background #eef1f3
|
||||||
height 8px
|
border-radius 4px
|
||||||
margin auto 0
|
|
||||||
background #fff
|
|
||||||
border-radius 100%
|
|
||||||
|
|
||||||
> .media
|
>>> .code
|
||||||
> img
|
margin 8px 0
|
||||||
display block
|
|
||||||
max-width 100%
|
|
||||||
|
|
||||||
> .location
|
>>> .quote
|
||||||
margin 4px 0
|
margin 8px
|
||||||
font-size 12px
|
padding 6px 12px
|
||||||
color #ccc
|
color #aaa
|
||||||
|
border-left solid 3px #eee
|
||||||
|
|
||||||
> .map
|
> .reply
|
||||||
width 100%
|
margin-right 8px
|
||||||
height 200px
|
color #717171
|
||||||
|
|
||||||
&:empty
|
> .rp
|
||||||
display none
|
margin-left 4px
|
||||||
|
font-style oblique
|
||||||
|
color #a0bf46
|
||||||
|
|
||||||
|
[data-is-me]:after
|
||||||
|
content "you"
|
||||||
|
padding 0 4px
|
||||||
|
margin-left 4px
|
||||||
|
font-size 80%
|
||||||
|
color $theme-color-foreground
|
||||||
|
background $theme-color
|
||||||
|
border-radius 4px
|
||||||
|
|
||||||
|
.mk-url-preview
|
||||||
|
margin-top 8px
|
||||||
|
|
||||||
|
> .channel
|
||||||
|
margin 0
|
||||||
|
|
||||||
|
> .tags
|
||||||
|
margin 4px 0 0 0
|
||||||
|
|
||||||
|
> *
|
||||||
|
display inline-block
|
||||||
|
margin 0 8px 0 0
|
||||||
|
padding 2px 8px 2px 16px
|
||||||
|
font-size 90%
|
||||||
|
color #8d969e
|
||||||
|
background #edf0f3
|
||||||
|
border-radius 4px
|
||||||
|
|
||||||
|
&:before
|
||||||
|
content ""
|
||||||
|
display block
|
||||||
|
position absolute
|
||||||
|
top 0
|
||||||
|
bottom 0
|
||||||
|
left 4px
|
||||||
|
width 8px
|
||||||
|
height 8px
|
||||||
|
margin auto 0
|
||||||
|
background #fff
|
||||||
|
border-radius 100%
|
||||||
|
|
||||||
|
> .media
|
||||||
|
> img
|
||||||
|
display block
|
||||||
|
max-width 100%
|
||||||
|
|
||||||
|
> .location
|
||||||
|
margin 4px 0
|
||||||
|
font-size 12px
|
||||||
|
color #ccc
|
||||||
|
|
||||||
|
> .map
|
||||||
|
width 100%
|
||||||
|
height 200px
|
||||||
|
|
||||||
|
&:empty
|
||||||
|
display none
|
||||||
|
|
||||||
|
> .mk-poll
|
||||||
|
font-size 80%
|
||||||
|
|
||||||
|
> .renote
|
||||||
|
margin 8px 0
|
||||||
|
|
||||||
|
> .mk-note-preview
|
||||||
|
padding 16px
|
||||||
|
border dashed 1px #c0dac6
|
||||||
|
border-radius 8px
|
||||||
|
|
||||||
> .app
|
> .app
|
||||||
font-size 12px
|
font-size 12px
|
||||||
color #ccc
|
color #ccc
|
||||||
|
|
||||||
> .mk-poll
|
|
||||||
font-size 80%
|
|
||||||
|
|
||||||
> .renote
|
|
||||||
margin 8px 0
|
|
||||||
|
|
||||||
> .mk-note-preview
|
|
||||||
padding 16px
|
|
||||||
border dashed 1px #c0dac6
|
|
||||||
border-radius 8px
|
|
||||||
|
|
||||||
> footer
|
> footer
|
||||||
> button
|
> button
|
||||||
margin 0
|
margin 0
|
||||||
@ -507,6 +558,12 @@ export default Vue.extend({
|
|||||||
@media (max-width 350px)
|
@media (max-width 350px)
|
||||||
display none
|
display none
|
||||||
|
|
||||||
|
.note[data-darkmode]
|
||||||
|
root(true)
|
||||||
|
|
||||||
|
.note:not([data-darkmode])
|
||||||
|
root(false)
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style lang="stylus" module>
|
<style lang="stylus" module>
|
||||||
|
@ -2,13 +2,15 @@
|
|||||||
<div class="mk-notes">
|
<div class="mk-notes">
|
||||||
<slot name="head"></slot>
|
<slot name="head"></slot>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<template v-for="(note, i) in _notes">
|
<transition-group name="mk-notes" class="transition">
|
||||||
<mk-note :note="note" :key="note.id" @update:note="onNoteUpdated(i, $event)"/>
|
<template v-for="(note, i) in _notes">
|
||||||
<p class="date" v-if="i != notes.length - 1 && note._date != _notes[i + 1]._date">
|
<mk-note :note="note" :key="note.id" @update:note="onNoteUpdated(i, $event)"/>
|
||||||
<span>%fa:angle-up%{{ note._datetext }}</span>
|
<p class="date" :key="note.id + '_date'" v-if="i != notes.length - 1 && note._date != _notes[i + 1]._date">
|
||||||
<span>%fa:angle-down%{{ _notes[i + 1]._datetext }}</span>
|
<span>%fa:angle-up%{{ note._datetext }}</span>
|
||||||
</p>
|
<span>%fa:angle-down%{{ _notes[i + 1]._datetext }}</span>
|
||||||
</template>
|
</p>
|
||||||
|
</template>
|
||||||
|
</transition-group>
|
||||||
<footer>
|
<footer>
|
||||||
<slot name="tail"></slot>
|
<slot name="tail"></slot>
|
||||||
</footer>
|
</footer>
|
||||||
@ -52,6 +54,31 @@ export default Vue.extend({
|
|||||||
border-radius 8px
|
border-radius 8px
|
||||||
box-shadow 0 0 0 1px rgba(0, 0, 0, 0.2)
|
box-shadow 0 0 0 1px rgba(0, 0, 0, 0.2)
|
||||||
|
|
||||||
|
.transition
|
||||||
|
.mk-notes-enter
|
||||||
|
.mk-notes-leave-to
|
||||||
|
opacity 0
|
||||||
|
transform translateY(-30px)
|
||||||
|
|
||||||
|
> *
|
||||||
|
transition transform .3s ease, opacity .3s ease
|
||||||
|
|
||||||
|
> .date
|
||||||
|
display block
|
||||||
|
margin 0
|
||||||
|
line-height 32px
|
||||||
|
text-align center
|
||||||
|
font-size 0.9em
|
||||||
|
color #aaa
|
||||||
|
background #fdfdfd
|
||||||
|
border-bottom solid 1px #eaeaea
|
||||||
|
|
||||||
|
span
|
||||||
|
margin 0 16px
|
||||||
|
|
||||||
|
[data-fa]
|
||||||
|
margin-right 8px
|
||||||
|
|
||||||
> .init
|
> .init
|
||||||
padding 64px 0
|
padding 64px 0
|
||||||
text-align center
|
text-align center
|
||||||
@ -73,22 +100,6 @@ export default Vue.extend({
|
|||||||
font-size 3em
|
font-size 3em
|
||||||
color #ccc
|
color #ccc
|
||||||
|
|
||||||
> .date
|
|
||||||
display block
|
|
||||||
margin 0
|
|
||||||
line-height 32px
|
|
||||||
text-align center
|
|
||||||
font-size 0.9em
|
|
||||||
color #aaa
|
|
||||||
background #fdfdfd
|
|
||||||
border-bottom solid 1px #eaeaea
|
|
||||||
|
|
||||||
span
|
|
||||||
margin 0 16px
|
|
||||||
|
|
||||||
[data-fa]
|
|
||||||
margin-right 8px
|
|
||||||
|
|
||||||
> footer
|
> footer
|
||||||
text-align center
|
text-align center
|
||||||
border-top solid 1px #eaeaea
|
border-top solid 1px #eaeaea
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
</header>
|
</header>
|
||||||
<div class="form">
|
<div class="form">
|
||||||
<mk-note-preview v-if="reply" :note="reply"/>
|
<mk-note-preview v-if="reply" :note="reply"/>
|
||||||
|
<input v-show="useCw" v-model="cw" placeholder="内容への注釈 (オプション)">
|
||||||
<textarea v-model="text" ref="text" :disabled="posting" :placeholder="reply ? '%i18n:!@reply-placeholder%' : '%i18n:!@note-placeholder%'"></textarea>
|
<textarea v-model="text" ref="text" :disabled="posting" :placeholder="reply ? '%i18n:!@reply-placeholder%' : '%i18n:!@note-placeholder%'"></textarea>
|
||||||
<div class="attaches" v-show="files.length != 0">
|
<div class="attaches" v-show="files.length != 0">
|
||||||
<x-draggable class="files" :list="files" :options="{ animation: 150 }">
|
<x-draggable class="files" :list="files" :options="{ animation: 150 }">
|
||||||
@ -24,6 +25,7 @@
|
|||||||
<button class="drive" @click="chooseFileFromDrive">%fa:cloud%</button>
|
<button class="drive" @click="chooseFileFromDrive">%fa:cloud%</button>
|
||||||
<button class="kao" @click="kao">%fa:R smile%</button>
|
<button class="kao" @click="kao">%fa:R smile%</button>
|
||||||
<button class="poll" @click="poll = true">%fa:chart-pie%</button>
|
<button class="poll" @click="poll = true">%fa:chart-pie%</button>
|
||||||
|
<button class="poll" @click="useCw = !useCw">%fa:eye-slash%</button>
|
||||||
<button class="geo" @click="geo ? removeGeo() : setGeo()">%fa:map-marker-alt%</button>
|
<button class="geo" @click="geo ? removeGeo() : setGeo()">%fa:map-marker-alt%</button>
|
||||||
<input ref="file" class="file" type="file" accept="image/*" multiple="multiple" @change="onChangeFile"/>
|
<input ref="file" class="file" type="file" accept="image/*" multiple="multiple" @change="onChangeFile"/>
|
||||||
</div>
|
</div>
|
||||||
@ -39,7 +41,9 @@ export default Vue.extend({
|
|||||||
components: {
|
components: {
|
||||||
XDraggable
|
XDraggable
|
||||||
},
|
},
|
||||||
|
|
||||||
props: ['reply'],
|
props: ['reply'],
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
posting: false,
|
posting: false,
|
||||||
@ -47,21 +51,27 @@ export default Vue.extend({
|
|||||||
uploadings: [],
|
uploadings: [],
|
||||||
files: [],
|
files: [],
|
||||||
poll: false,
|
poll: false,
|
||||||
geo: null
|
geo: null,
|
||||||
|
useCw: false,
|
||||||
|
cw: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.focus();
|
this.focus();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
focus() {
|
focus() {
|
||||||
(this.$refs.text as any).focus();
|
(this.$refs.text as any).focus();
|
||||||
},
|
},
|
||||||
|
|
||||||
chooseFile() {
|
chooseFile() {
|
||||||
(this.$refs.file as any).click();
|
(this.$refs.file as any).click();
|
||||||
},
|
},
|
||||||
|
|
||||||
chooseFileFromDrive() {
|
chooseFileFromDrive() {
|
||||||
(this as any).apis.chooseDriveFile({
|
(this as any).apis.chooseDriveFile({
|
||||||
multiple: true
|
multiple: true
|
||||||
@ -69,23 +79,29 @@ export default Vue.extend({
|
|||||||
files.forEach(this.attachMedia);
|
files.forEach(this.attachMedia);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
attachMedia(driveFile) {
|
attachMedia(driveFile) {
|
||||||
this.files.push(driveFile);
|
this.files.push(driveFile);
|
||||||
this.$emit('change-attached-media', this.files);
|
this.$emit('change-attached-media', this.files);
|
||||||
},
|
},
|
||||||
|
|
||||||
detachMedia(file) {
|
detachMedia(file) {
|
||||||
this.files = this.files.filter(x => x.id != file.id);
|
this.files = this.files.filter(x => x.id != file.id);
|
||||||
this.$emit('change-attached-media', this.files);
|
this.$emit('change-attached-media', this.files);
|
||||||
},
|
},
|
||||||
|
|
||||||
onChangeFile() {
|
onChangeFile() {
|
||||||
Array.from((this.$refs.file as any).files).forEach(this.upload);
|
Array.from((this.$refs.file as any).files).forEach(this.upload);
|
||||||
},
|
},
|
||||||
|
|
||||||
upload(file) {
|
upload(file) {
|
||||||
(this.$refs.uploader as any).upload(file);
|
(this.$refs.uploader as any).upload(file);
|
||||||
},
|
},
|
||||||
|
|
||||||
onChangeUploadings(uploads) {
|
onChangeUploadings(uploads) {
|
||||||
this.$emit('change-uploadings', uploads);
|
this.$emit('change-uploadings', uploads);
|
||||||
},
|
},
|
||||||
|
|
||||||
setGeo() {
|
setGeo() {
|
||||||
if (navigator.geolocation == null) {
|
if (navigator.geolocation == null) {
|
||||||
alert('お使いの端末は位置情報に対応していません');
|
alert('お使いの端末は位置情報に対応していません');
|
||||||
@ -100,15 +116,18 @@ export default Vue.extend({
|
|||||||
enableHighAccuracy: true
|
enableHighAccuracy: true
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
removeGeo() {
|
removeGeo() {
|
||||||
this.geo = null;
|
this.geo = null;
|
||||||
},
|
},
|
||||||
|
|
||||||
clear() {
|
clear() {
|
||||||
this.text = '';
|
this.text = '';
|
||||||
this.files = [];
|
this.files = [];
|
||||||
this.poll = false;
|
this.poll = false;
|
||||||
this.$emit('change-attached-media');
|
this.$emit('change-attached-media');
|
||||||
},
|
},
|
||||||
|
|
||||||
post() {
|
post() {
|
||||||
this.posting = true;
|
this.posting = true;
|
||||||
const viaMobile = (this as any).os.i.clientSettings.disableViaMobile !== true;
|
const viaMobile = (this as any).os.i.clientSettings.disableViaMobile !== true;
|
||||||
@ -117,6 +136,7 @@ export default Vue.extend({
|
|||||||
mediaIds: this.files.length > 0 ? this.files.map(f => f.id) : undefined,
|
mediaIds: this.files.length > 0 ? this.files.map(f => f.id) : undefined,
|
||||||
replyId: this.reply ? this.reply.id : undefined,
|
replyId: this.reply ? this.reply.id : undefined,
|
||||||
poll: this.poll ? (this.$refs.poll as any).get() : undefined,
|
poll: this.poll ? (this.$refs.poll as any).get() : undefined,
|
||||||
|
cw: this.useCw ? this.cw || '' : undefined,
|
||||||
geo: this.geo ? {
|
geo: this.geo ? {
|
||||||
coordinates: [this.geo.longitude, this.geo.latitude],
|
coordinates: [this.geo.longitude, this.geo.latitude],
|
||||||
altitude: this.geo.altitude,
|
altitude: this.geo.altitude,
|
||||||
@ -133,10 +153,12 @@ export default Vue.extend({
|
|||||||
this.posting = false;
|
this.posting = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
cancel() {
|
cancel() {
|
||||||
this.$emit('cancel');
|
this.$emit('cancel');
|
||||||
this.$destroy();
|
this.$destroy();
|
||||||
},
|
},
|
||||||
|
|
||||||
kao() {
|
kao() {
|
||||||
this.text += getKao();
|
this.text += getKao();
|
||||||
}
|
}
|
||||||
@ -236,14 +258,12 @@ export default Vue.extend({
|
|||||||
> .file
|
> .file
|
||||||
display none
|
display none
|
||||||
|
|
||||||
|
> input
|
||||||
> textarea
|
> textarea
|
||||||
display block
|
display block
|
||||||
padding 12px
|
padding 12px
|
||||||
margin 0
|
margin 0
|
||||||
width 100%
|
width 100%
|
||||||
max-width 100%
|
|
||||||
min-width 100%
|
|
||||||
min-height 80px
|
|
||||||
font-size 16px
|
font-size 16px
|
||||||
color #333
|
color #333
|
||||||
border none
|
border none
|
||||||
@ -253,6 +273,11 @@ export default Vue.extend({
|
|||||||
&:disabled
|
&:disabled
|
||||||
opacity 0.5
|
opacity 0.5
|
||||||
|
|
||||||
|
> textarea
|
||||||
|
max-width 100%
|
||||||
|
min-width 100%
|
||||||
|
min-height 80px
|
||||||
|
|
||||||
> .upload
|
> .upload
|
||||||
> .drive
|
> .drive
|
||||||
> .kao
|
> .kao
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mk-timeline">
|
<div class="mk-timeline">
|
||||||
|
<div class="newer-indicator" :style="{ top: $store.state.uiHeaderHeight + 'px' }" v-show="queue.length > 0"></div>
|
||||||
<mk-friends-maker v-if="alone"/>
|
<mk-friends-maker v-if="alone"/>
|
||||||
<mk-notes :notes="notes">
|
<mk-notes :notes="notes">
|
||||||
<div class="init" v-if="fetching">
|
<div class="init" v-if="fetching">
|
||||||
@ -9,7 +10,7 @@
|
|||||||
%fa:R comments%
|
%fa:R comments%
|
||||||
%i18n:@empty%
|
%i18n:@empty%
|
||||||
</div>
|
</div>
|
||||||
<button v-if="!fetching && existMore" @click="more" :disabled="moreFetching" slot="tail">
|
<button v-if="canFetchMore" @click="more" :disabled="moreFetching" slot="tail">
|
||||||
<span v-if="!moreFetching">%i18n:@load-more%</span>
|
<span v-if="!moreFetching">%i18n:@load-more%</span>
|
||||||
<span v-if="moreFetching">%i18n:common.loading%<mk-ellipsis/></span>
|
<span v-if="moreFetching">%i18n:common.loading%<mk-ellipsis/></span>
|
||||||
</button>
|
</button>
|
||||||
@ -20,7 +21,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
|
|
||||||
const limit = 10;
|
const fetchLimit = 10;
|
||||||
|
const displayLimit = 30;
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
props: {
|
props: {
|
||||||
@ -30,21 +32,29 @@ export default Vue.extend({
|
|||||||
default: null
|
default: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
fetching: true,
|
fetching: true,
|
||||||
moreFetching: false,
|
moreFetching: false,
|
||||||
notes: [],
|
notes: [],
|
||||||
|
queue: [],
|
||||||
existMore: false,
|
existMore: false,
|
||||||
connection: null,
|
connection: null,
|
||||||
connectionId: null
|
connectionId: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
alone(): boolean {
|
alone(): boolean {
|
||||||
return (this as any).os.i.followingCount == 0;
|
return (this as any).os.i.followingCount == 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
canFetchMore(): boolean {
|
||||||
|
return !this.moreFetching && !this.fetching && this.notes.length > 0 && this.existMore;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.connection = (this as any).os.stream.getConnection();
|
this.connection = (this as any).os.stream.getConnection();
|
||||||
this.connectionId = (this as any).os.stream.use();
|
this.connectionId = (this as any).os.stream.use();
|
||||||
@ -53,22 +63,35 @@ export default Vue.extend({
|
|||||||
this.connection.on('follow', this.onChangeFollowing);
|
this.connection.on('follow', this.onChangeFollowing);
|
||||||
this.connection.on('unfollow', this.onChangeFollowing);
|
this.connection.on('unfollow', this.onChangeFollowing);
|
||||||
|
|
||||||
this.fetch();
|
window.addEventListener('scroll', this.onScroll);
|
||||||
|
|
||||||
|
this.fetch();
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.connection.off('note', this.onNote);
|
this.connection.off('note', this.onNote);
|
||||||
this.connection.off('follow', this.onChangeFollowing);
|
this.connection.off('follow', this.onChangeFollowing);
|
||||||
this.connection.off('unfollow', this.onChangeFollowing);
|
this.connection.off('unfollow', this.onChangeFollowing);
|
||||||
(this as any).os.stream.dispose(this.connectionId);
|
(this as any).os.stream.dispose(this.connectionId);
|
||||||
|
|
||||||
|
window.removeEventListener('scroll', this.onScroll);
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
isScrollTop() {
|
||||||
|
return window.scrollY <= 8;
|
||||||
|
},
|
||||||
|
|
||||||
fetch(cb?) {
|
fetch(cb?) {
|
||||||
|
this.queue = [];
|
||||||
this.fetching = true;
|
this.fetching = true;
|
||||||
(this as any).api('notes/timeline', {
|
(this as any).api('notes/timeline', {
|
||||||
limit: limit + 1,
|
limit: fetchLimit + 1,
|
||||||
untilDate: this.date ? (this.date as any).getTime() : undefined
|
untilDate: this.date ? (this.date as any).getTime() : undefined,
|
||||||
|
includeMyRenotes: (this as any).os.i.clientSettings.showMyRenotes,
|
||||||
|
includeRenotedMyNotes: (this as any).os.i.clientSettings.showRenotedMyNotes
|
||||||
}).then(notes => {
|
}).then(notes => {
|
||||||
if (notes.length == limit + 1) {
|
if (notes.length == fetchLimit + 1) {
|
||||||
notes.pop();
|
notes.pop();
|
||||||
this.existMore = true;
|
this.existMore = true;
|
||||||
}
|
}
|
||||||
@ -78,13 +101,16 @@ this.fetch();
|
|||||||
if (cb) cb();
|
if (cb) cb();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
more() {
|
more() {
|
||||||
this.moreFetching = true;
|
this.moreFetching = true;
|
||||||
(this as any).api('notes/timeline', {
|
(this as any).api('notes/timeline', {
|
||||||
limit: limit + 1,
|
limit: fetchLimit + 1,
|
||||||
untilId: this.notes[this.notes.length - 1].id
|
untilId: this.notes[this.notes.length - 1].id,
|
||||||
|
includeMyRenotes: (this as any).os.i.clientSettings.showMyRenotes,
|
||||||
|
includeRenotedMyNotes: (this as any).os.i.clientSettings.showRenotedMyNotes
|
||||||
}).then(notes => {
|
}).then(notes => {
|
||||||
if (notes.length == limit + 1) {
|
if (notes.length == fetchLimit + 1) {
|
||||||
notes.pop();
|
notes.pop();
|
||||||
this.existMore = true;
|
this.existMore = true;
|
||||||
} else {
|
} else {
|
||||||
@ -94,20 +120,71 @@ this.fetch();
|
|||||||
this.moreFetching = false;
|
this.moreFetching = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onNote(note) {
|
|
||||||
|
prependNote(note) {
|
||||||
|
// Prepent a note
|
||||||
this.notes.unshift(note);
|
this.notes.unshift(note);
|
||||||
|
|
||||||
const isTop = window.scrollY > 8;
|
// オーバーフローしたら古い投稿は捨てる
|
||||||
if (isTop) this.notes.pop();
|
if (this.notes.length >= displayLimit) {
|
||||||
|
this.notes = this.notes.slice(0, displayLimit);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
releaseQueue() {
|
||||||
|
this.queue.forEach(n => this.prependNote(n));
|
||||||
|
this.queue = [];
|
||||||
|
},
|
||||||
|
|
||||||
|
onNote(note) {
|
||||||
|
//#region 弾く
|
||||||
|
const isMyNote = note.userId == (this as any).os.i.id;
|
||||||
|
const isPureRenote = note.renoteId != null && note.text == null && note.mediaIds.length == 0 && note.poll == null;
|
||||||
|
|
||||||
|
if ((this as any).os.i.clientSettings.showMyRenotes === false) {
|
||||||
|
if (isMyNote && isPureRenote) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((this as any).os.i.clientSettings.showRenotedMyNotes === false) {
|
||||||
|
if (isPureRenote && (note.renote.userId == (this as any).os.i.id)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
if (this.isScrollTop()) {
|
||||||
|
this.prependNote(note);
|
||||||
|
} else {
|
||||||
|
this.queue.unshift(note);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
onChangeFollowing() {
|
onChangeFollowing() {
|
||||||
this.fetch();
|
this.fetch();
|
||||||
|
},
|
||||||
|
|
||||||
|
onScroll() {
|
||||||
|
if (this.isScrollTop()) {
|
||||||
|
this.releaseQueue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.mk-friends-maker
|
@import '~const.styl'
|
||||||
margin-bottom 8px
|
|
||||||
|
.mk-timeline
|
||||||
|
> .newer-indicator
|
||||||
|
position -webkit-sticky
|
||||||
|
position sticky
|
||||||
|
z-index 100
|
||||||
|
height 3px
|
||||||
|
background $theme-color
|
||||||
|
|
||||||
|
> .mk-friends-maker
|
||||||
|
margin-bottom 8px
|
||||||
</style>
|
</style>
|
||||||
|
@ -32,6 +32,8 @@ export default Vue.extend({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.$store.commit('setUiHeaderHeight', 48);
|
||||||
|
|
||||||
if ((this as any).os.isSignedIn) {
|
if ((this as any).os.isSignedIn) {
|
||||||
this.connection = (this as any).os.stream.getConnection();
|
this.connection = (this as any).os.stream.getConnection();
|
||||||
this.connectionId = (this as any).os.stream.use();
|
this.connectionId = (this as any).os.stream.use();
|
||||||
@ -150,6 +152,9 @@ export default Vue.extend({
|
|||||||
width 100%
|
width 100%
|
||||||
box-shadow 0 1px 0 rgba(#000, 0.075)
|
box-shadow 0 1px 0 rgba(#000, 0.075)
|
||||||
|
|
||||||
|
&, *
|
||||||
|
user-select none
|
||||||
|
|
||||||
> .main
|
> .main
|
||||||
color rgba(#fff, 0.9)
|
color rgba(#fff, 0.9)
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<mk-ui>
|
<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">
|
<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>
|
<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>
|
<header>
|
||||||
<div class="banner" :style="user.bannerUrl ? `background-image: url(${user.bannerUrl}?thumbnail&size=1024)` : ''"></div>
|
<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'
|
@import '~const.styl'
|
||||||
|
|
||||||
main
|
main
|
||||||
|
> .is-suspended
|
||||||
> .is-remote
|
> .is-remote
|
||||||
padding 16px
|
&.is-suspended
|
||||||
color #573c08
|
color #570808
|
||||||
background #fff0db
|
background #ffdbdb
|
||||||
|
|
||||||
|
&.is-remote
|
||||||
|
color #573c08
|
||||||
|
background #fff0db
|
||||||
|
|
||||||
> p
|
> p
|
||||||
margin 0 auto
|
margin 0 auto
|
||||||
max-width 1024px
|
padding 14px
|
||||||
|
max-width 600px
|
||||||
font-size 14px
|
font-size 14px
|
||||||
|
|
||||||
> a
|
> a
|
||||||
font-weight bold
|
font-weight bold
|
||||||
|
|
||||||
@media (max-width 500px)
|
@media (max-width 500px)
|
||||||
|
padding 12px
|
||||||
font-size 12px
|
font-size 12px
|
||||||
|
|
||||||
> header
|
> header
|
||||||
|
@ -29,12 +29,6 @@ props:
|
|||||||
desc:
|
desc:
|
||||||
ja: "投稿の本文 (ローカルの場合Markdown風のフォーマット)"
|
ja: "投稿の本文 (ローカルの場合Markdown風のフォーマット)"
|
||||||
en: "The text of this note (in Markdown like format if local)"
|
en: "The text of this note (in Markdown like format if local)"
|
||||||
- name: "textHtml"
|
|
||||||
type: "string"
|
|
||||||
optional: true
|
|
||||||
desc:
|
|
||||||
ja: "投稿の本文 (HTML) (投稿時は無視)"
|
|
||||||
en: "The text of this note (in HTML. Ignored when posting.)"
|
|
||||||
- name: "mediaIds"
|
- name: "mediaIds"
|
||||||
type: "id(DriveFile)[]"
|
type: "id(DriveFile)[]"
|
||||||
optional: true
|
optional: true
|
||||||
|
@ -29,12 +29,6 @@ props:
|
|||||||
desc:
|
desc:
|
||||||
ja: "投稿の本文 (ローカルの場合Markdown風のフォーマット)"
|
ja: "投稿の本文 (ローカルの場合Markdown風のフォーマット)"
|
||||||
en: "The text of this note (in Markdown like format if local)"
|
en: "The text of this note (in Markdown like format if local)"
|
||||||
- name: "textHtml"
|
|
||||||
type: "string"
|
|
||||||
optional: true
|
|
||||||
desc:
|
|
||||||
ja: "投稿の本文 (HTML) (投稿時は無視)"
|
|
||||||
en: "The text of this note (in HTML. Ignored when posting.)"
|
|
||||||
- name: "mediaIds"
|
- name: "mediaIds"
|
||||||
type: "id(DriveFile)[]"
|
type: "id(DriveFile)[]"
|
||||||
optional: true
|
optional: true
|
||||||
|
9
src/client/docs/follow.ja.pug
Normal file
9
src/client/docs/follow.ja.pug
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
h1 フォロー
|
||||||
|
p ユーザーをフォローすると、タイムラインにそのユーザーの投稿が表示されるようになります。ただし、他のユーザーに対する返信は含まれません。
|
||||||
|
p ユーザーをフォローするには、ユーザーページの「フォロー」ボタンをクリックします。フォローを解除するには、もう一度クリックします。
|
||||||
|
|
||||||
|
section
|
||||||
|
h2 ストーキング
|
||||||
|
p ユーザーをフォローしている状態では、さらに「ストーキング」モードをオンにすることができます。ストーキングを行うと、タイムラインにそのユーザーの全ての投稿が表示されるようになります。つまり、他のユーザーに対する返信も含まれることになります。
|
||||||
|
p ストーキングするには、ユーザーページの「ストークする」をクリックします。ストーキングをやめるには、もう一度クリックします。
|
||||||
|
p ストーキングしていることは相手に通知されません。
|
@ -1,7 +1,10 @@
|
|||||||
import * as mongo from 'mongodb';
|
import * as mongo from 'mongodb';
|
||||||
|
import deepcopy = require('deepcopy');
|
||||||
import db from '../db/mongodb';
|
import db from '../db/mongodb';
|
||||||
|
import { pack as packNote } from './note';
|
||||||
|
|
||||||
const Favorite = db.get<IFavorite>('favorites');
|
const Favorite = db.get<IFavorite>('favorites');
|
||||||
|
Favorite.createIndex(['userId', 'noteId'], { unique: true });
|
||||||
export default Favorite;
|
export default Favorite;
|
||||||
|
|
||||||
export type IFavorite = {
|
export type IFavorite = {
|
||||||
@ -37,3 +40,35 @@ export async function deleteFavorite(favorite: string | mongo.ObjectID | IFavori
|
|||||||
_id: f._id
|
_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);
|
||||||
|
});
|
||||||
|
@ -12,7 +12,6 @@ export interface IMessagingMessage {
|
|||||||
_id: mongo.ObjectID;
|
_id: mongo.ObjectID;
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
text: string;
|
text: string;
|
||||||
textHtml: string;
|
|
||||||
userId: mongo.ObjectID;
|
userId: mongo.ObjectID;
|
||||||
recipientId: mongo.ObjectID;
|
recipientId: mongo.ObjectID;
|
||||||
isRead: boolean;
|
isRead: boolean;
|
||||||
|
@ -24,7 +24,7 @@ export function isValidText(text: string): boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function isValidCw(text: string): boolean {
|
export function isValidCw(text: string): boolean {
|
||||||
return text.length <= 100 && text.trim() != '';
|
return text.length <= 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type INote = {
|
export type INote = {
|
||||||
@ -38,7 +38,6 @@ export type INote = {
|
|||||||
poll: any; // todo
|
poll: any; // todo
|
||||||
text: string;
|
text: string;
|
||||||
tags: string[];
|
tags: string[];
|
||||||
textHtml: string;
|
|
||||||
cw: string;
|
cw: string;
|
||||||
userId: mongo.ObjectID;
|
userId: mongo.ObjectID;
|
||||||
appId: mongo.ObjectID;
|
appId: mongo.ObjectID;
|
||||||
|
@ -14,6 +14,7 @@ const queue = createQueue({
|
|||||||
export function createHttp(data) {
|
export function createHttp(data) {
|
||||||
return queue
|
return queue
|
||||||
.create('http', data)
|
.create('http', data)
|
||||||
|
.removeOnComplete(true)
|
||||||
.events(false)
|
.events(false)
|
||||||
.attempts(8)
|
.attempts(8)
|
||||||
.backoff({ delay: 16384, type: 'exponential' });
|
.backoff({ delay: 16384, type: 'exponential' });
|
||||||
@ -21,11 +22,12 @@ export function createHttp(data) {
|
|||||||
|
|
||||||
export function deliver(user, content, to) {
|
export function deliver(user, content, to) {
|
||||||
createHttp({
|
createHttp({
|
||||||
|
title: 'deliver',
|
||||||
type: 'deliver',
|
type: 'deliver',
|
||||||
user,
|
user,
|
||||||
content,
|
content,
|
||||||
to
|
to
|
||||||
}).removeOnComplete(true).save();
|
}).save();
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function() {
|
export default function() {
|
||||||
|
@ -33,6 +33,11 @@ export default async (job: kue.Job, done): Promise<void> => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
user = await User.findOne({ usernameLower: username, host: host.toLowerCase() }) as IRemoteUser;
|
user = await User.findOne({ usernameLower: username, host: host.toLowerCase() }) as IRemoteUser;
|
||||||
|
|
||||||
|
// アクティビティを送信してきたユーザーがまだMisskeyサーバーに登録されていなかったら登録する
|
||||||
|
if (user === null) {
|
||||||
|
user = await resolvePerson(activity.actor);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
user = await User.findOne({
|
user = await User.findOne({
|
||||||
host: { $ne: null },
|
host: { $ne: null },
|
||||||
|
@ -22,7 +22,6 @@ export default async function(actor: IRemoteUser, uri: string): Promise<void> {
|
|||||||
$set: {
|
$set: {
|
||||||
deletedAt: new Date(),
|
deletedAt: new Date(),
|
||||||
text: null,
|
text: null,
|
||||||
textHtml: null,
|
|
||||||
mediaIds: [],
|
mediaIds: [],
|
||||||
poll: null
|
poll: null
|
||||||
}
|
}
|
||||||
|
18
src/remote/activitypub/misc/get-note-html.ts
Normal file
18
src/remote/activitypub/misc/get-note-html.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import { INote } from "../../../models/note";
|
||||||
|
import toHtml from '../../../text/html';
|
||||||
|
import parse from '../../../text/parse';
|
||||||
|
import config from '../../../config';
|
||||||
|
|
||||||
|
export default function(note: INote) {
|
||||||
|
if (note.text == null) return null;
|
||||||
|
|
||||||
|
let html = toHtml(parse(note.text));
|
||||||
|
|
||||||
|
if (note.poll != null) {
|
||||||
|
const url = `${config.url}/notes/${note._id}`;
|
||||||
|
// TODO: i18n
|
||||||
|
html += `<p>【投票】<br />${url}</p>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return html;
|
||||||
|
}
|
@ -11,6 +11,11 @@ const log = debug('misskey:activitypub');
|
|||||||
* Imageを作成します。
|
* Imageを作成します。
|
||||||
*/
|
*/
|
||||||
export async function createImage(actor: IRemoteUser, value): Promise<IDriveFile> {
|
export async function createImage(actor: IRemoteUser, value): Promise<IDriveFile> {
|
||||||
|
// 投稿者が凍結されていたらスキップ
|
||||||
|
if (actor.isSuspended) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const image = await new Resolver().resolve(value);
|
const image = await new Resolver().resolve(value);
|
||||||
|
|
||||||
if (image.url == null) {
|
if (image.url == null) {
|
||||||
|
@ -58,6 +58,11 @@ export async function createNote(value: any, resolver?: Resolver, silent = false
|
|||||||
// 投稿者をフェッチ
|
// 投稿者をフェッチ
|
||||||
const actor = await resolvePerson(note.attributedTo) as IRemoteUser;
|
const actor = await resolvePerson(note.attributedTo) as IRemoteUser;
|
||||||
|
|
||||||
|
// 投稿者が凍結されていたらスキップ
|
||||||
|
if (actor.isSuspended) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
//#region Visibility
|
//#region Visibility
|
||||||
let visibility = 'public';
|
let visibility = 'public';
|
||||||
if (!note.to.includes('https://www.w3.org/ns/activitystreams#Public')) visibility = 'unlisted';
|
if (!note.to.includes('https://www.w3.org/ns/activitystreams#Public')) visibility = 'unlisted';
|
||||||
|
@ -80,27 +80,38 @@ export async function createPerson(value: any, resolver?: Resolver): Promise<IUs
|
|||||||
const summaryDOM = JSDOM.fragment(person.summary);
|
const summaryDOM = JSDOM.fragment(person.summary);
|
||||||
|
|
||||||
// Create user
|
// Create user
|
||||||
const user = await User.insert({
|
let user: IRemoteUser;
|
||||||
avatarId: null,
|
try {
|
||||||
bannerId: null,
|
user = await User.insert({
|
||||||
createdAt: Date.parse(person.published) || null,
|
avatarId: null,
|
||||||
description: summaryDOM.textContent,
|
bannerId: null,
|
||||||
followersCount,
|
createdAt: Date.parse(person.published) || null,
|
||||||
followingCount,
|
description: summaryDOM.textContent,
|
||||||
notesCount,
|
followersCount,
|
||||||
name: person.name,
|
followingCount,
|
||||||
driveCapacity: 1024 * 1024 * 8, // 8MiB
|
notesCount,
|
||||||
username: person.preferredUsername,
|
name: person.name,
|
||||||
usernameLower: person.preferredUsername.toLowerCase(),
|
driveCapacity: 1024 * 1024 * 8, // 8MiB
|
||||||
host,
|
username: person.preferredUsername,
|
||||||
publicKey: {
|
usernameLower: person.preferredUsername.toLowerCase(),
|
||||||
id: person.publicKey.id,
|
host,
|
||||||
publicKeyPem: person.publicKey.publicKeyPem
|
publicKey: {
|
||||||
},
|
id: person.publicKey.id,
|
||||||
inbox: person.inbox,
|
publicKeyPem: person.publicKey.publicKeyPem
|
||||||
uri: person.id,
|
},
|
||||||
url: person.url
|
inbox: person.inbox,
|
||||||
}) as IRemoteUser;
|
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 アイコンとヘッダー画像をフェッチ
|
//#region アイコンとヘッダー画像をフェッチ
|
||||||
const [avatarId, bannerId] = (await Promise.all([
|
const [avatarId, bannerId] = (await Promise.all([
|
||||||
|
@ -4,6 +4,7 @@ import config from '../../../config';
|
|||||||
import DriveFile from '../../../models/drive-file';
|
import DriveFile from '../../../models/drive-file';
|
||||||
import Note, { INote } from '../../../models/note';
|
import Note, { INote } from '../../../models/note';
|
||||||
import User from '../../../models/user';
|
import User from '../../../models/user';
|
||||||
|
import toHtml from '../misc/get-note-html';
|
||||||
|
|
||||||
export default async function renderNote(note: INote, dive = true) {
|
export default async function renderNote(note: INote, dive = true) {
|
||||||
const promisedFiles = note.mediaIds
|
const promisedFiles = note.mediaIds
|
||||||
@ -48,7 +49,7 @@ export default async function renderNote(note: INote, dive = true) {
|
|||||||
id: `${config.url}/notes/${note._id}`,
|
id: `${config.url}/notes/${note._id}`,
|
||||||
type: 'Note',
|
type: 'Note',
|
||||||
attributedTo,
|
attributedTo,
|
||||||
content: note.textHtml,
|
content: toHtml(note),
|
||||||
published: note.createdAt.toISOString(),
|
published: note.createdAt.toISOString(),
|
||||||
to: 'https://www.w3.org/ns/activitystreams#Public',
|
to: 'https://www.w3.org/ns/activitystreams#Public',
|
||||||
cc: `${attributedTo}/followers`,
|
cc: `${attributedTo}/followers`,
|
||||||
|
@ -40,5 +40,10 @@ export default (user: ILocalUser, url: string, object) => new Promise((resolve,
|
|||||||
keyId: `acct:${user.username}@${config.host}`
|
keyId: `acct:${user.username}@${config.host}`
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Signature: Signature ... => Signature: ...
|
||||||
|
let sig = req.getHeader('Signature').toString();
|
||||||
|
sig = sig.replace(/^Signature /, '');
|
||||||
|
req.setHeader('Signature', sig);
|
||||||
|
|
||||||
req.end(JSON.stringify(object));
|
req.end(JSON.stringify(object));
|
||||||
});
|
});
|
||||||
|
@ -233,6 +233,12 @@ const endpoints: Endpoint[] = [
|
|||||||
kind: 'notification-read'
|
kind: 'notification-read'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: 'i/favorites',
|
||||||
|
withCredential: true,
|
||||||
|
kind: 'favorites-read'
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: 'othello/match',
|
name: 'othello/match',
|
||||||
withCredential: true
|
withCredential: true
|
||||||
|
@ -2,43 +2,52 @@
|
|||||||
* Module dependencies
|
* Module dependencies
|
||||||
*/
|
*/
|
||||||
import $ from 'cafy';
|
import $ from 'cafy';
|
||||||
import Favorite from '../../../../models/favorite';
|
import Favorite, { pack } from '../../../../models/favorite';
|
||||||
import { pack } from '../../../../models/note';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get followers of a user
|
* Get favorited notes
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
*/
|
||||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
module.exports = (params, user) => new Promise(async (res, rej) => {
|
||||||
// Get 'limit' parameter
|
// Get 'limit' parameter
|
||||||
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
|
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
|
||||||
if (limitErr) return rej('invalid limit param');
|
if (limitErr) return rej('invalid limit param');
|
||||||
|
|
||||||
// Get 'offset' parameter
|
// Get 'sinceId' parameter
|
||||||
const [offset = 0, offsetErr] = $(params.offset).optional.number().min(0).$;
|
const [sinceId, sinceIdErr] = $(params.sinceId).optional.id().$;
|
||||||
if (offsetErr) return rej('invalid offset param');
|
if (sinceIdErr) return rej('invalid sinceId param');
|
||||||
|
|
||||||
// Get 'sort' parameter
|
// Get 'untilId' parameter
|
||||||
const [sort = 'desc', sortError] = $(params.sort).optional.string().or('desc asc').$;
|
const [untilId, untilIdErr] = $(params.untilId).optional.id().$;
|
||||||
if (sortError) return rej('invalid sort param');
|
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
|
// Get favorites
|
||||||
const favorites = await Favorite
|
const favorites = await Favorite
|
||||||
.find({
|
.find(query, { limit, sort });
|
||||||
userId: user._id
|
|
||||||
}, {
|
|
||||||
limit: limit,
|
|
||||||
skip: offset,
|
|
||||||
sort: {
|
|
||||||
_id: sort == 'asc' ? 1 : -1
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Serialize
|
// Serialize
|
||||||
res(await Promise.all(favorites.map(async favorite =>
|
res(await Promise.all(favorites.map(favorite => pack(favorite, user))));
|
||||||
await pack(favorite.noteId)
|
|
||||||
)));
|
|
||||||
});
|
});
|
||||||
|
@ -12,8 +12,6 @@ import { pack } from '../../../../../models/messaging-message';
|
|||||||
import publishUserStream from '../../../../../publishers/stream';
|
import publishUserStream from '../../../../../publishers/stream';
|
||||||
import { publishMessagingStream, publishMessagingIndexStream } from '../../../../../publishers/stream';
|
import { publishMessagingStream, publishMessagingIndexStream } from '../../../../../publishers/stream';
|
||||||
import pushSw from '../../../../../publishers/push-sw';
|
import pushSw from '../../../../../publishers/push-sw';
|
||||||
import html from '../../../../../text/html';
|
|
||||||
import parse from '../../../../../text/parse';
|
|
||||||
import config from '../../../../../config';
|
import config from '../../../../../config';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -77,7 +75,6 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
|
|||||||
fileId: file ? file._id : undefined,
|
fileId: file ? file._id : undefined,
|
||||||
recipientId: recipient._id,
|
recipientId: recipient._id,
|
||||||
text: text ? text : undefined,
|
text: text ? text : undefined,
|
||||||
textHtml: text ? html(parse(text)) : undefined,
|
|
||||||
userId: user._id,
|
userId: user._id,
|
||||||
isRead: false
|
isRead: false
|
||||||
});
|
});
|
||||||
|
@ -23,11 +23,11 @@ module.exports = (params, user: ILocalUser, app: IApp) => new Promise(async (res
|
|||||||
if (visibilityErr) return rej('invalid visibility');
|
if (visibilityErr) return rej('invalid visibility');
|
||||||
|
|
||||||
// Get 'text' parameter
|
// Get 'text' parameter
|
||||||
const [text, textErr] = $(params.text).optional.string().pipe(isValidText).$;
|
const [text = null, textErr] = $(params.text).optional.nullable.string().pipe(isValidText).$;
|
||||||
if (textErr) return rej('invalid text');
|
if (textErr) return rej('invalid text');
|
||||||
|
|
||||||
// Get 'cw' parameter
|
// Get 'cw' parameter
|
||||||
const [cw, cwErr] = $(params.cw).optional.string().pipe(isValidCw).$;
|
const [cw, cwErr] = $(params.cw).optional.nullable.string().pipe(isValidCw).$;
|
||||||
if (cwErr) return rej('invalid cw');
|
if (cwErr) return rej('invalid cw');
|
||||||
|
|
||||||
// Get 'viaMobile' parameter
|
// Get 'viaMobile' parameter
|
||||||
@ -187,14 +187,14 @@ module.exports = (params, user: ILocalUser, app: IApp) => new Promise(async (res
|
|||||||
const note = await create(user, {
|
const note = await create(user, {
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
media: files,
|
media: files,
|
||||||
poll: poll,
|
poll,
|
||||||
text: text,
|
text,
|
||||||
reply,
|
reply,
|
||||||
renote,
|
renote,
|
||||||
cw: cw,
|
cw,
|
||||||
tags: tags,
|
tags,
|
||||||
app: app,
|
app,
|
||||||
viaMobile: viaMobile,
|
viaMobile,
|
||||||
visibility,
|
visibility,
|
||||||
geo
|
geo
|
||||||
});
|
});
|
||||||
|
@ -37,6 +37,14 @@ module.exports = async (params, user, app) => {
|
|||||||
throw 'only one of sinceId, untilId, sinceDate, untilDate can be specified';
|
throw 'only one of sinceId, untilId, sinceDate, untilDate can be specified';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get 'includeMyRenotes' parameter
|
||||||
|
const [includeMyRenotes = true, includeMyRenotesErr] = $(params.includeMyRenotes).optional.boolean().$;
|
||||||
|
if (includeMyRenotesErr) throw 'invalid includeMyRenotes param';
|
||||||
|
|
||||||
|
// Get 'includeRenotedMyNotes' parameter
|
||||||
|
const [includeRenotedMyNotes = true, includeRenotedMyNotesErr] = $(params.includeRenotedMyNotes).optional.boolean().$;
|
||||||
|
if (includeRenotedMyNotesErr) throw 'invalid includeRenotedMyNotes param';
|
||||||
|
|
||||||
const [followings, watchingChannelIds, mutedUserIds] = await Promise.all([
|
const [followings, watchingChannelIds, mutedUserIds] = await Promise.all([
|
||||||
// フォローを取得
|
// フォローを取得
|
||||||
// Fetch following
|
// Fetch following
|
||||||
@ -84,38 +92,76 @@ module.exports = async (params, user, app) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const query = {
|
const query = {
|
||||||
$or: [{
|
$and: [{
|
||||||
$and: [{
|
$or: [{
|
||||||
// フォローしている人のタイムラインへの投稿
|
$and: [{
|
||||||
$or: followQuery
|
// フォローしている人のタイムラインへの投稿
|
||||||
}, {
|
$or: followQuery
|
||||||
// 「タイムラインへの」投稿に限定するためにチャンネルが指定されていないもののみに限る
|
|
||||||
$or: [{
|
|
||||||
channelId: {
|
|
||||||
$exists: false
|
|
||||||
}
|
|
||||||
}, {
|
}, {
|
||||||
channelId: null
|
// 「タイムラインへの」投稿に限定するためにチャンネルが指定されていないもののみに限る
|
||||||
|
$or: [{
|
||||||
|
channelId: {
|
||||||
|
$exists: false
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
channelId: null
|
||||||
|
}]
|
||||||
}]
|
}]
|
||||||
}]
|
}, {
|
||||||
}, {
|
// Watchしているチャンネルへの投稿
|
||||||
// Watchしているチャンネルへの投稿
|
channelId: {
|
||||||
channelId: {
|
$in: watchingChannelIds
|
||||||
$in: watchingChannelIds
|
}
|
||||||
}
|
}],
|
||||||
}],
|
// mute
|
||||||
// mute
|
userId: {
|
||||||
userId: {
|
$nin: mutedUserIds
|
||||||
$nin: mutedUserIds
|
},
|
||||||
},
|
'_reply.userId': {
|
||||||
'_reply.userId': {
|
$nin: mutedUserIds
|
||||||
$nin: mutedUserIds
|
},
|
||||||
},
|
'_renote.userId': {
|
||||||
'_renote.userId': {
|
$nin: mutedUserIds
|
||||||
$nin: mutedUserIds
|
},
|
||||||
},
|
}]
|
||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
|
// MongoDBではトップレベルで否定ができないため、De Morganの法則を利用してクエリします。
|
||||||
|
// つまり、「『自分の投稿かつRenote』ではない」を「『自分の投稿ではない』または『Renoteではない』」と表現します。
|
||||||
|
// for details: https://en.wikipedia.org/wiki/De_Morgan%27s_laws
|
||||||
|
|
||||||
|
if (includeMyRenotes === false) {
|
||||||
|
query.$and.push({
|
||||||
|
$or: [{
|
||||||
|
userId: { $ne: user._id }
|
||||||
|
}, {
|
||||||
|
renoteId: null
|
||||||
|
}, {
|
||||||
|
text: { $ne: null }
|
||||||
|
}, {
|
||||||
|
mediaIds: { $ne: [] }
|
||||||
|
}, {
|
||||||
|
poll: { $ne: null }
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (includeRenotedMyNotes === false) {
|
||||||
|
query.$and.push({
|
||||||
|
$or: [{
|
||||||
|
'_renote.userId': { $ne: user._id }
|
||||||
|
}, {
|
||||||
|
renoteId: null
|
||||||
|
}, {
|
||||||
|
text: { $ne: null }
|
||||||
|
}, {
|
||||||
|
mediaIds: { $ne: [] }
|
||||||
|
}, {
|
||||||
|
poll: { $ne: null }
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (sinceId) {
|
if (sinceId) {
|
||||||
sort._id = 1;
|
sort._id = 1;
|
||||||
query._id = {
|
query._id = {
|
||||||
|
@ -10,6 +10,7 @@ import * as Koa from 'koa';
|
|||||||
import * as Router from 'koa-router';
|
import * as Router from 'koa-router';
|
||||||
import * as mount from 'koa-mount';
|
import * as mount from 'koa-mount';
|
||||||
import * as compress from 'koa-compress';
|
import * as compress from 'koa-compress';
|
||||||
|
import * as logger from 'koa-logger';
|
||||||
|
|
||||||
import activityPub from './activitypub';
|
import activityPub from './activitypub';
|
||||||
import webFinger from './webfinger';
|
import webFinger from './webfinger';
|
||||||
@ -19,6 +20,12 @@ import config from '../config';
|
|||||||
const app = new Koa();
|
const app = new Koa();
|
||||||
app.proxy = true;
|
app.proxy = true;
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV != 'production') {
|
||||||
|
// Logger
|
||||||
|
app.use(logger());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compress response
|
||||||
app.use(compress({
|
app.use(compress({
|
||||||
flush: zlib.constants.Z_SYNC_FLUSH
|
flush: zlib.constants.Z_SYNC_FLUSH
|
||||||
}));
|
}));
|
||||||
|
@ -61,7 +61,7 @@ router.get('/manifest.json', async ctx => {
|
|||||||
router.use('/docs', docs.routes());
|
router.use('/docs', docs.routes());
|
||||||
|
|
||||||
// URL preview endpoint
|
// URL preview endpoint
|
||||||
router.get('url', require('./url-preview'));
|
router.get('/url', require('./url-preview'));
|
||||||
|
|
||||||
// Render base html for all requests
|
// Render base html for all requests
|
||||||
router.get('*', async ctx => {
|
router.get('*', async ctx => {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user