mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-04 10:46:09 +02:00
Add messaging widget
This commit is contained in:
50
src/web/app/desktop/tags/home-widgets/messaging.tag
Normal file
50
src/web/app/desktop/tags/home-widgets/messaging.tag
Normal file
@@ -0,0 +1,50 @@
|
||||
<mk-messaging-home-widget>
|
||||
<virtual if={ data.design == 0 }>
|
||||
<p class="title"><i class="fa fa-comments"></i>%i18n:desktop.tags.mk-messaging-home-widget.title%</p>
|
||||
</virtual>
|
||||
<mk-messaging ref="index" compact={ true }/>
|
||||
<style>
|
||||
:scope
|
||||
display block
|
||||
overflow hidden
|
||||
background #fff
|
||||
|
||||
> .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)
|
||||
|
||||
> i
|
||||
margin-right 4px
|
||||
|
||||
> mk-messaging
|
||||
max-height 250px
|
||||
overflow auto
|
||||
|
||||
</style>
|
||||
<script>
|
||||
this.data = {
|
||||
design: 0
|
||||
};
|
||||
|
||||
this.mixin('widget');
|
||||
|
||||
this.on('mount', () => {
|
||||
this.refs.index.on('navigate-user', user => {
|
||||
riot.mount(document.body.appendChild(document.createElement('mk-messaging-room-window')), {
|
||||
user: user
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
this.func = () => {
|
||||
if (++this.data.design == 2) this.data.design = 0;
|
||||
this.save();
|
||||
};
|
||||
</script>
|
||||
</mk-messaging-home-widget>
|
||||
@@ -19,6 +19,7 @@
|
||||
<option value="user-recommendation">おすすめユーザー</option>
|
||||
<option value="recommended-polls">投票</option>
|
||||
<option value="post-form">投稿フォーム</option>
|
||||
<option value="messaging">メッセージ</option>
|
||||
<option value="channel">チャンネル</option>
|
||||
<option value="access-log">アクセスログ</option>
|
||||
<option value="server">サーバー情報</option>
|
||||
|
||||
@@ -44,6 +44,7 @@ require('./home-widgets/channel.tag');
|
||||
require('./home-widgets/timemachine.tag');
|
||||
require('./home-widgets/post-form.tag');
|
||||
require('./home-widgets/access-log.tag');
|
||||
require('./home-widgets/messaging.tag');
|
||||
require('./timeline.tag');
|
||||
require('./messaging/window.tag');
|
||||
require('./messaging/room-window.tag');
|
||||
|
||||
Reference in New Issue
Block a user