summaryrefslogtreecommitdiff
path: root/src/client/app/mobile
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-06-16 18:42:49 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-06-16 18:42:49 +0900
commit555a0f276cfabfc5288bb76bdf1274cf9e7fb8d4 (patch)
tree030dfd1736ef4e13f36e9e773f9e5c23beebd372 /src/client/app/mobile
parent3.0.1 (diff)
downloadmisskey-555a0f276cfabfc5288bb76bdf1274cf9e7fb8d4.tar.gz
misskey-555a0f276cfabfc5288bb76bdf1274cf9e7fb8d4.tar.bz2
misskey-555a0f276cfabfc5288bb76bdf1274cf9e7fb8d4.zip
MisskeyShare
Diffstat (limited to 'src/client/app/mobile')
-rw-r--r--src/client/app/mobile/script.ts2
-rw-r--r--src/client/app/mobile/views/components/index.ts2
-rw-r--r--src/client/app/mobile/views/components/post-form.vue30
-rw-r--r--src/client/app/mobile/views/pages/share.vue56
4 files changed, 87 insertions, 3 deletions
diff --git a/src/client/app/mobile/script.ts b/src/client/app/mobile/script.ts
index 8ee078d621..1572fd73ed 100644
--- a/src/client/app/mobile/script.ts
+++ b/src/client/app/mobile/script.ts
@@ -37,6 +37,7 @@ import MkUserList from './views/pages/user-list.vue';
import MkSettings from './views/pages/settings.vue';
import MkOthello from './views/pages/othello.vue';
import MkTag from './views/pages/tag.vue';
+import MkShare from './views/pages/share.vue';
/**
* init
@@ -73,6 +74,7 @@ init((launch) => {
{ path: '/selectdrive', component: MkSelectDrive },
{ path: '/search', component: MkSearch },
{ path: '/tags/:tag', component: MkTag },
+ { path: '/share', component: MkShare },
{ path: '/othello', name: 'othello', component: MkOthello },
{ path: '/othello/:game', component: MkOthello },
{ path: '/@:user', component: MkUser },
diff --git a/src/client/app/mobile/views/components/index.ts b/src/client/app/mobile/views/components/index.ts
index 5ed8427b05..38c130ecbf 100644
--- a/src/client/app/mobile/views/components/index.ts
+++ b/src/client/app/mobile/views/components/index.ts
@@ -22,6 +22,7 @@ import userTimeline from './user-timeline.vue';
import userListTimeline from './user-list-timeline.vue';
import activity from './activity.vue';
import widgetContainer from './widget-container.vue';
+import postForm from './post-form.vue';
Vue.component('mk-ui', ui);
Vue.component('mk-note', note);
@@ -45,3 +46,4 @@ Vue.component('mk-user-timeline', userTimeline);
Vue.component('mk-user-list-timeline', userListTimeline);
Vue.component('mk-activity', activity);
Vue.component('mk-widget-container', widgetContainer);
+Vue.component('mk-post-form', postForm);
diff --git a/src/client/app/mobile/views/components/post-form.vue b/src/client/app/mobile/views/components/post-form.vue
index 88853fa236..62fa185085 100644
--- a/src/client/app/mobile/views/components/post-form.vue
+++ b/src/client/app/mobile/views/components/post-form.vue
@@ -54,7 +54,25 @@ export default Vue.extend({
MkVisibilityChooser
},
- props: ['reply', 'renote'],
+ props: {
+ reply: {
+ type: Object,
+ required: false
+ },
+ renote: {
+ type: Object,
+ required: false
+ },
+ initialText: {
+ type: String,
+ required: false
+ },
+ instant: {
+ type: Boolean,
+ required: false,
+ default: false
+ }
+ },
data() {
return {
@@ -112,6 +130,10 @@ export default Vue.extend({
},
mounted() {
+ if (this.initialText) {
+ this.text = this.initialText;
+ }
+
if (this.reply && this.reply.user.host != null) {
this.text = `@${this.reply.user.username}@${this.reply.user.host} `;
}
@@ -252,8 +274,10 @@ export default Vue.extend({
visibleUserIds: this.visibility == 'specified' ? this.visibleUsers.map(u => u.id) : undefined,
viaMobile: viaMobile
}).then(data => {
- this.$emit('note');
- this.$destroy();
+ this.$emit('posted');
+ this.$nextTick(() => {
+ this.$destroy();
+ });
}).catch(err => {
this.posting = false;
});
diff --git a/src/client/app/mobile/views/pages/share.vue b/src/client/app/mobile/views/pages/share.vue
new file mode 100644
index 0000000000..c69498007d
--- /dev/null
+++ b/src/client/app/mobile/views/pages/share.vue
@@ -0,0 +1,56 @@
+<template>
+<div class="azibmfpleajagva420swmu4c3r7ni7iw">
+ <h1>Misskeyで共有</h1>
+ <div>
+ <mk-signin v-if="!$store.getters.isSignedIn"/>
+ <mk-post-form v-else-if="!posted" :initial-text="text" :instant="true" @posted="posted = true"/>
+ <p v-if="posted" class="posted">%fa:check%</p>
+ </div>
+ <ui-button class="close" v-if="posted" @click="close">閉じる</ui-button>
+</div>
+</template>
+
+<script lang="ts">
+import Vue from 'vue';
+
+export default Vue.extend({
+ data() {
+ return {
+ posted: false,
+ text: new URLSearchParams(location.search).get('text')
+ };
+ },
+ methods: {
+ close() {
+ window.close();
+ }
+ }
+});
+</script>
+
+<style lang="stylus" scoped>
+.azibmfpleajagva420swmu4c3r7ni7iw
+ > h1
+ margin 8px 0
+ color #555
+ font-size 20px
+ text-align center
+
+ > div
+ max-width 500px
+ margin 0 auto
+
+ > .posted
+ display block
+ margin 0 auto
+ padding 64px
+ text-align center
+ background #fff
+ border-radius 6px
+ width calc(100% - 32px)
+
+ > .close
+ display block
+ margin 16px auto
+ width calc(100% - 32px)
+</style>