From d19897c8c763ad26b15743796e99215b5710ebd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=93=E3=81=B4=E3=81=AA=E3=81=9F=E3=81=BF=E3=81=BD?= <syuilotan@yahoo.co.jp> Date: Fri, 16 Feb 2018 15:52:28 +0900 Subject: [PATCH] wip --- .../app/mobile/tags/page/notifications.tag | 39 ------------------- .../app/mobile/views/pages/notification.vue | 31 +++++++++++++++ 2 files changed, 31 insertions(+), 39 deletions(-) delete mode 100644 src/web/app/mobile/tags/page/notifications.tag create mode 100644 src/web/app/mobile/views/pages/notification.vue diff --git a/src/web/app/mobile/tags/page/notifications.tag b/src/web/app/mobile/tags/page/notifications.tag deleted file mode 100644 index 169ff029b1..0000000000 --- a/src/web/app/mobile/tags/page/notifications.tag +++ /dev/null @@ -1,39 +0,0 @@ -<mk-notifications-page> - <mk-ui ref="ui"> - <mk-notifications ref="notifications"/> - </mk-ui> - <style lang="stylus" scoped> - :scope - display block - </style> - <script lang="typescript"> - import ui from '../../scripts/ui-event'; - import Progress from '../../../common/scripts/loading'; - - this.mixin('api'); - - this.on('mount', () => { - document.title = 'Misskey | %i18n:mobile.tags.mk-notifications-page.notifications%'; - ui.trigger('title', '%fa:R bell%%i18n:mobile.tags.mk-notifications-page.notifications%'); - document.documentElement.style.background = '#313a42'; - - ui.trigger('func', () => { - this.readAll(); - }, '%fa:check%'); - - Progress.start(); - - this.$refs.ui.refs.notifications.on('fetched', () => { - Progress.done(); - }); - }); - - this.readAll = () => { - const ok = window.confirm('%i18n:mobile.tags.mk-notifications-page.read-all%'); - - if (!ok) return; - - this.$root.$data.os.api('notifications/mark_as_read_all'); - }; - </script> -</mk-notifications-page> diff --git a/src/web/app/mobile/views/pages/notification.vue b/src/web/app/mobile/views/pages/notification.vue new file mode 100644 index 0000000000..03d8b6cad8 --- /dev/null +++ b/src/web/app/mobile/views/pages/notification.vue @@ -0,0 +1,31 @@ +<template> +<mk-ui :func="fn" func-icon="%fa:check%"> + <span slot="header">%fa:R bell%%i18n:mobile.tags.mk-notifications-page.notifications%</span> + <mk-notifications @fetched="onFetched"/> +</mk-ui> +</template> + +<script lang="ts"> +import Vue from 'vue'; +import Progress from '../../../common/scripts/loading'; + +export default Vue.extend({ + mounted() { + document.title = 'Misskey | %i18n:mobile.tags.mk-notifications-page.notifications%'; + document.documentElement.style.background = '#313a42'; + + Progress.start(); + }, + methods: { + fn() { + const ok = window.confirm('%i18n:mobile.tags.mk-notifications-page.read-all%'); + if (!ok) return; + + this.$root.$data.os.api('notifications/mark_as_read_all'); + }, + onFetched() { + Progress.done(); + } + } +}); +</script> -- GitLab