From 7d377925a02a785966ca22f9f9be085a6ee808c1 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 17 Feb 2018 02:24:10 +0900 Subject: [PATCH] wip --- src/web/app/common/views/components/index.ts | 2 + .../views/components/special-message.vue | 4 +- .../views/components/widgets/profile.vue | 2 +- src/web/app/desktop/script.ts | 3 + src/web/app/desktop/views/components/index.ts | 2 + .../views/components/notifications.vue | 28 ++++----- .../desktop/views/components/post-preview.vue | 4 +- .../views/components/posts-post-sub.vue | 4 +- .../desktop/views/components/posts-post.vue | 8 +-- .../desktop/views/components/user-preview.vue | 4 +- src/web/app/desktop/views/directives/index.ts | 6 ++ .../desktop/views/directives/user-preview.ts | 63 +++++++++++++++++++ src/web/app/mobile/script.ts | 3 + src/web/app/mobile/views/directives/index.ts | 6 ++ .../mobile/views/directives/user-preview.ts | 2 + 15 files changed, 115 insertions(+), 26 deletions(-) create mode 100644 src/web/app/desktop/views/directives/index.ts create mode 100644 src/web/app/desktop/views/directives/user-preview.ts create mode 100644 src/web/app/mobile/views/directives/index.ts create mode 100644 src/web/app/mobile/views/directives/user-preview.ts diff --git a/src/web/app/common/views/components/index.ts b/src/web/app/common/views/components/index.ts index 452621756..10d09ce65 100644 --- a/src/web/app/common/views/components/index.ts +++ b/src/web/app/common/views/components/index.ts @@ -10,6 +10,7 @@ import reactionsViewer from './reactions-viewer.vue'; import time from './time.vue'; import images from './images.vue'; import uploader from './uploader.vue'; +import specialMessage from './special-message.vue'; Vue.component('mk-signin', signin); Vue.component('mk-signup', signup); @@ -21,3 +22,4 @@ Vue.component('mk-reactions-viewer', reactionsViewer); Vue.component('mk-time', time); Vue.component('mk-images', images); Vue.component('mk-uploader', uploader); +Vue.component('mk-special-message', specialMessage); diff --git a/src/web/app/common/views/components/special-message.vue b/src/web/app/common/views/components/special-message.vue index 900afe178..2fd4d6515 100644 --- a/src/web/app/common/views/components/special-message.vue +++ b/src/web/app/common/views/components/special-message.vue @@ -15,10 +15,10 @@ export default Vue.extend({ }, computed: { d(): number { - return now.getDate(); + return this.now.getDate(); }, m(): number { - return now.getMonth() + 1; + return this.now.getMonth() + 1; } } }); diff --git a/src/web/app/common/views/components/widgets/profile.vue b/src/web/app/common/views/components/widgets/profile.vue index 70902c7cf..d64ffad93 100644 --- a/src/web/app/common/views/components/widgets/profile.vue +++ b/src/web/app/common/views/components/widgets/profile.vue @@ -13,7 +13,7 @@ @click="wapi_setAvatar" alt="avatar" title="クリックでアバター編集" - :v-user-preview={ I.id } + v-user-preview={ I.id } /> { I.name }

@{ I.username }

diff --git a/src/web/app/desktop/script.ts b/src/web/app/desktop/script.ts index d6ad0202d..1377965ea 100644 --- a/src/web/app/desktop/script.ts +++ b/src/web/app/desktop/script.ts @@ -21,6 +21,9 @@ init(async (launch) => { */ fuckAdBlock(); + // Register directives + require('./views/directives'); + // Register components require('./views/components'); diff --git a/src/web/app/desktop/views/components/index.ts b/src/web/app/desktop/views/components/index.ts index 6b58215be..7a7438214 100644 --- a/src/web/app/desktop/views/components/index.ts +++ b/src/web/app/desktop/views/components/index.ts @@ -25,6 +25,7 @@ import imagesImageDialog from './images-image-dialog.vue'; import notifications from './notifications.vue'; import postForm from './post-form.vue'; import repostForm from './repost-form.vue'; +import followButton from './follow-button.vue'; Vue.component('mk-ui', ui); Vue.component('mk-ui-header', uiHeader); @@ -51,3 +52,4 @@ Vue.component('mk-images-image-dialog', imagesImageDialog); Vue.component('mk-notifications', notifications); Vue.component('mk-post-form', postForm); Vue.component('mk-repost-form', repostForm); +Vue.component('mk-follow-button', followButton); diff --git a/src/web/app/desktop/views/components/notifications.vue b/src/web/app/desktop/views/components/notifications.vue index 5826fc210..d211a933f 100644 --- a/src/web/app/desktop/views/components/notifications.vue +++ b/src/web/app/desktop/views/components/notifications.vue @@ -5,13 +5,13 @@