wip
This commit is contained in:
parent
b47c847211
commit
44a0952c0f
8 changed files with 357 additions and 569 deletions
|
|
@ -1,89 +0,0 @@
|
|||
require('./contextmenu.tag');
|
||||
require('./dialog.tag');
|
||||
require('./window.tag');
|
||||
require('./input-dialog.tag');
|
||||
require('./follow-button.tag');
|
||||
require('./drive/base-contextmenu.tag');
|
||||
require('./drive/file-contextmenu.tag');
|
||||
require('./drive/folder-contextmenu.tag');
|
||||
require('./drive/file.tag');
|
||||
require('./drive/folder.tag');
|
||||
require('./drive/nav-folder.tag');
|
||||
require('./drive/browser-window.tag');
|
||||
require('./drive/browser.tag');
|
||||
require('./select-file-from-drive-window.tag');
|
||||
require('./select-folder-from-drive-window.tag');
|
||||
require('./crop-window.tag');
|
||||
require('./settings.tag');
|
||||
require('./settings-window.tag');
|
||||
require('./analog-clock.tag');
|
||||
require('./notifications.tag');
|
||||
require('./post-form-window.tag');
|
||||
require('./post-form.tag');
|
||||
require('./post-preview.tag');
|
||||
require('./repost-form-window.tag');
|
||||
require('./home-widgets/user-recommendation.tag');
|
||||
require('./home-widgets/timeline.tag');
|
||||
require('./home-widgets/mentions.tag');
|
||||
require('./home-widgets/calendar.tag');
|
||||
require('./home-widgets/donation.tag');
|
||||
require('./home-widgets/tips.tag');
|
||||
require('./home-widgets/nav.tag');
|
||||
require('./home-widgets/profile.tag');
|
||||
require('./home-widgets/notifications.tag');
|
||||
require('./home-widgets/rss-reader.tag');
|
||||
require('./home-widgets/photo-stream.tag');
|
||||
require('./home-widgets/broadcast.tag');
|
||||
require('./home-widgets/version.tag');
|
||||
require('./home-widgets/recommended-polls.tag');
|
||||
require('./home-widgets/trends.tag');
|
||||
require('./home-widgets/activity.tag');
|
||||
require('./home-widgets/server.tag');
|
||||
require('./home-widgets/slideshow.tag');
|
||||
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');
|
||||
require('./following-setuper.tag');
|
||||
require('./ellipsis-icon.tag');
|
||||
require('./ui.tag');
|
||||
require('./home.tag');
|
||||
require('./user-timeline.tag');
|
||||
require('./user.tag');
|
||||
require('./big-follow-button.tag');
|
||||
require('./pages/entrance.tag');
|
||||
require('./pages/home.tag');
|
||||
require('./pages/home-customize.tag');
|
||||
require('./pages/user.tag');
|
||||
require('./pages/post.tag');
|
||||
require('./pages/search.tag');
|
||||
require('./pages/not-found.tag');
|
||||
require('./pages/selectdrive.tag');
|
||||
require('./pages/drive.tag');
|
||||
require('./pages/messaging-room.tag');
|
||||
require('./autocomplete-suggestion.tag');
|
||||
require('./progress-dialog.tag');
|
||||
require('./user-preview.tag');
|
||||
require('./post-detail.tag');
|
||||
require('./post-detail-sub.tag');
|
||||
require('./search.tag');
|
||||
require('./search-posts.tag');
|
||||
require('./set-avatar-suggestion.tag');
|
||||
require('./set-banner-suggestion.tag');
|
||||
require('./repost-form.tag');
|
||||
require('./sub-post-content.tag');
|
||||
require('./images.tag');
|
||||
require('./donation.tag');
|
||||
require('./users-list.tag');
|
||||
require('./user-following.tag');
|
||||
require('./user-followers.tag');
|
||||
require('./user-following-window.tag');
|
||||
require('./user-followers-window.tag');
|
||||
require('./list-user.tag');
|
||||
require('./detailed-post-window.tag');
|
||||
require('./widgets/calendar.tag');
|
||||
require('./widgets/activity.tag');
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
<mk-set-avatar-suggestion @click="set">
|
||||
<p><b>アバターを設定</b>してみませんか?
|
||||
<button @click="close">%fa:times%</button>
|
||||
</p>
|
||||
<style lang="stylus" scoped>
|
||||
:scope
|
||||
display block
|
||||
cursor pointer
|
||||
color #fff
|
||||
background #a8cad0
|
||||
|
||||
&:hover
|
||||
background #70abb5
|
||||
|
||||
> p
|
||||
display block
|
||||
margin 0 auto
|
||||
padding 8px
|
||||
max-width 1024px
|
||||
|
||||
> a
|
||||
font-weight bold
|
||||
color #fff
|
||||
|
||||
> button
|
||||
position absolute
|
||||
top 0
|
||||
right 0
|
||||
padding 8px
|
||||
color #fff
|
||||
|
||||
</style>
|
||||
<script lang="typescript">
|
||||
import updateAvatar from '../scripts/update-avatar';
|
||||
|
||||
this.mixin('i');
|
||||
|
||||
this.set = () => {
|
||||
updateAvatar(this.I);
|
||||
};
|
||||
|
||||
this.close = e => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
this.$destroy();
|
||||
};
|
||||
</script>
|
||||
</mk-set-avatar-suggestion>
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
<mk-set-banner-suggestion @click="set">
|
||||
<p><b>バナーを設定</b>してみませんか?
|
||||
<button @click="close">%fa:times%</button>
|
||||
</p>
|
||||
<style lang="stylus" scoped>
|
||||
:scope
|
||||
display block
|
||||
cursor pointer
|
||||
color #fff
|
||||
background #a8cad0
|
||||
|
||||
&:hover
|
||||
background #70abb5
|
||||
|
||||
> p
|
||||
display block
|
||||
margin 0 auto
|
||||
padding 8px
|
||||
max-width 1024px
|
||||
|
||||
> a
|
||||
font-weight bold
|
||||
color #fff
|
||||
|
||||
> button
|
||||
position absolute
|
||||
top 0
|
||||
right 0
|
||||
padding 8px
|
||||
color #fff
|
||||
|
||||
</style>
|
||||
<script lang="typescript">
|
||||
import updateBanner from '../scripts/update-banner';
|
||||
|
||||
this.mixin('i');
|
||||
|
||||
this.set = () => {
|
||||
updateBanner(this.I);
|
||||
};
|
||||
|
||||
this.close = e => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
this.$destroy();
|
||||
};
|
||||
</script>
|
||||
</mk-set-banner-suggestion>
|
||||
|
|
@ -2,8 +2,9 @@
|
|||
<div class="mk-sub-post-content">
|
||||
<div class="body">
|
||||
<a class="reply" v-if="post.reply_id">%fa:reply%</a>
|
||||
<span ref="text"></span>
|
||||
<mk-post-html :ast="post.ast" :i="$root.$data.os.i"/>
|
||||
<a class="quote" v-if="post.repost_id" :href="`/post:${post.repost_id}`">RP: ...</a>
|
||||
<mk-url-preview v-for="url in urls" :url="url" :key="url"/>
|
||||
</div>
|
||||
<details v-if="post.media">
|
||||
<summary>({{ post.media.length }}つのメディア)</summary>
|
||||
|
|
@ -16,23 +17,23 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="typescript">
|
||||
import compile from '../../common/scripts/text-compiler';
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
|
||||
this.mixin('user-preview');
|
||||
|
||||
this.post = this.opts.post;
|
||||
|
||||
this.on('mount', () => {
|
||||
if (this.post.text) {
|
||||
const tokens = this.post.ast;
|
||||
this.$refs.text.innerHTML = compile(tokens, false);
|
||||
|
||||
Array.from(this.$refs.text.children).forEach(e => {
|
||||
if (e.tagName == 'MK-URL') riot.mount(e);
|
||||
});
|
||||
export default Vue.extend({
|
||||
props: ['post'],
|
||||
computed: {
|
||||
urls(): string[] {
|
||||
if (this.post.ast) {
|
||||
return this.post.ast
|
||||
.filter(t => (t.type == 'url' || t.type == 'link') && !t.silent)
|
||||
.map(t => t.url);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
|
|
|
|||
|
|
@ -76,6 +76,19 @@ import Vue from 'vue';
|
|||
import dateStringify from '../../../common/scripts/date-stringify';
|
||||
import MkPostFormWindow from './post-form-window.vue';
|
||||
import MkRepostFormWindow from './repost-form-window.vue';
|
||||
import MkPostMenu from '../../../common/views/components/post-menu.vue';
|
||||
import MkReactionPicker from '../../../common/views/components/reaction-picker.vue';
|
||||
|
||||
function focus(el, fn) {
|
||||
const target = fn(el);
|
||||
if (target) {
|
||||
if (target.hasAttribute('tabindex')) {
|
||||
target.focus();
|
||||
} else {
|
||||
focus(target, fn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['post'],
|
||||
|
|
@ -171,83 +184,63 @@ export default Vue.extend({
|
|||
post: this.p
|
||||
}
|
||||
}).$mount().$el);
|
||||
},
|
||||
react() {
|
||||
document.body.appendChild(new MkReactionPicker({
|
||||
propsData: {
|
||||
source: this.$refs.menuButton,
|
||||
post: this.p
|
||||
}
|
||||
}).$mount().$el);
|
||||
},
|
||||
menu() {
|
||||
document.body.appendChild(new MkPostMenu({
|
||||
propsData: {
|
||||
source: this.$refs.menuButton,
|
||||
post: this.p
|
||||
}
|
||||
}).$mount().$el);
|
||||
},
|
||||
onKeydown(e) {
|
||||
let shouldBeCancel = true;
|
||||
|
||||
switch (true) {
|
||||
case e.which == 38: // [↑]
|
||||
case e.which == 74: // [j]
|
||||
case e.which == 9 && e.shiftKey: // [Shift] + [Tab]
|
||||
focus(this.$el, e => e.previousElementSibling);
|
||||
break;
|
||||
|
||||
case e.which == 40: // [↓]
|
||||
case e.which == 75: // [k]
|
||||
case e.which == 9: // [Tab]
|
||||
focus(this.$el, e => e.nextElementSibling);
|
||||
break;
|
||||
|
||||
case e.which == 81: // [q]
|
||||
case e.which == 69: // [e]
|
||||
this.repost();
|
||||
break;
|
||||
|
||||
case e.which == 70: // [f]
|
||||
case e.which == 76: // [l]
|
||||
//this.like();
|
||||
break;
|
||||
|
||||
case e.which == 82: // [r]
|
||||
this.reply();
|
||||
break;
|
||||
|
||||
default:
|
||||
shouldBeCancel = false;
|
||||
}
|
||||
|
||||
if (shouldBeCancel) e.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script lang="typescript">
|
||||
|
||||
|
||||
this.react = () => {
|
||||
riot.mount(document.body.appendChild(document.createElement('mk-reaction-picker')), {
|
||||
source: this.$refs.reactButton,
|
||||
post: this.p
|
||||
});
|
||||
};
|
||||
|
||||
this.menu = () => {
|
||||
riot.mount(document.body.appendChild(document.createElement('mk-post-menu')), {
|
||||
source: this.$refs.menuButton,
|
||||
post: this.p
|
||||
});
|
||||
};
|
||||
|
||||
this.onKeyDown = e => {
|
||||
let shouldBeCancel = true;
|
||||
|
||||
switch (true) {
|
||||
case e.which == 38: // [↑]
|
||||
case e.which == 74: // [j]
|
||||
case e.which == 9 && e.shiftKey: // [Shift] + [Tab]
|
||||
focus(this.root, e => e.previousElementSibling);
|
||||
break;
|
||||
|
||||
case e.which == 40: // [↓]
|
||||
case e.which == 75: // [k]
|
||||
case e.which == 9: // [Tab]
|
||||
focus(this.root, e => e.nextElementSibling);
|
||||
break;
|
||||
|
||||
case e.which == 81: // [q]
|
||||
case e.which == 69: // [e]
|
||||
this.repost();
|
||||
break;
|
||||
|
||||
case e.which == 70: // [f]
|
||||
case e.which == 76: // [l]
|
||||
this.like();
|
||||
break;
|
||||
|
||||
case e.which == 82: // [r]
|
||||
this.reply();
|
||||
break;
|
||||
|
||||
default:
|
||||
shouldBeCancel = false;
|
||||
}
|
||||
|
||||
if (shouldBeCancel) e.preventDefault();
|
||||
};
|
||||
|
||||
this.onDblClick = () => {
|
||||
riot.mount(document.body.appendChild(document.createElement('mk-detailed-post-window')), {
|
||||
post: this.p.id
|
||||
});
|
||||
};
|
||||
|
||||
function focus(el, fn) {
|
||||
const target = fn(el);
|
||||
if (target) {
|
||||
if (target.hasAttribute('tabindex')) {
|
||||
target.focus();
|
||||
} else {
|
||||
focus(target, fn);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.mk-timeline-post
|
||||
margin 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue