2018-06-16 04:42:49 -05:00
|
|
|
<template>
|
|
|
|
<div class="azibmfpleajagva420swmu4c3r7ni7iw">
|
2018-11-08 12:44:35 -06:00
|
|
|
<h1>{{ $t('share-with', { name }) }}</h1>
|
2018-06-16 04:42:49 -05:00
|
|
|
<div>
|
|
|
|
<mk-signin v-if="!$store.getters.isSignedIn"/>
|
2019-03-11 22:55:43 -05:00
|
|
|
<mk-post-form v-else-if="!posted" :initial-text="template" :instant="true" @posted="posted = true"/>
|
2018-11-05 10:40:11 -06:00
|
|
|
<p v-if="posted" class="posted"><fa icon="check"/></p>
|
2018-06-16 04:42:49 -05:00
|
|
|
</div>
|
2018-11-08 12:44:35 -06:00
|
|
|
<ui-button class="close" v-if="posted" @click="close">{{ $t('@.close') }}</ui-button>
|
2018-06-16 04:42:49 -05:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
2018-11-08 12:44:35 -06:00
|
|
|
import i18n from '../../../i18n';
|
2018-06-16 04:42:49 -05:00
|
|
|
|
|
|
|
export default Vue.extend({
|
2018-11-08 12:44:35 -06:00
|
|
|
i18n: i18n('mobile/views/pages/share.vue'),
|
2018-06-16 04:42:49 -05:00
|
|
|
data() {
|
|
|
|
return {
|
2018-08-25 12:05:42 -05:00
|
|
|
name: null,
|
2018-06-16 04:42:49 -05:00
|
|
|
posted: false,
|
2019-03-11 22:55:43 -05:00
|
|
|
text: new URLSearchParams(location.search).get('text'),
|
|
|
|
url: new URLSearchParams(location.search).get('url'),
|
|
|
|
title: new URLSearchParams(location.search).get('title'),
|
2018-06-16 04:42:49 -05:00
|
|
|
};
|
|
|
|
},
|
2019-03-11 22:55:43 -05:00
|
|
|
computed: {
|
|
|
|
template(): string {
|
|
|
|
let t = '';
|
2019-03-14 01:19:02 -05:00
|
|
|
if (this.title && this.url) t += `【[${this.title}](${this.url})】\n`;
|
|
|
|
if (this.title && !this.url) t += `【${this.title}】\n`;
|
|
|
|
if (this.text) t += `${this.text}\n`;
|
|
|
|
if (!this.title && this.url) t += `${this.url}`;
|
2019-03-11 22:55:43 -05:00
|
|
|
return t.trim();
|
|
|
|
}
|
|
|
|
},
|
2018-06-16 04:42:49 -05:00
|
|
|
methods: {
|
|
|
|
close() {
|
|
|
|
window.close();
|
|
|
|
}
|
2018-08-25 12:05:42 -05:00
|
|
|
},
|
|
|
|
mounted() {
|
2018-11-08 17:13:34 -06:00
|
|
|
this.$root.getMeta().then(meta => {
|
2019-04-07 07:50:36 -05:00
|
|
|
this.name = meta.name || 'Misskey';
|
2018-08-25 12:05:42 -05:00
|
|
|
});
|
2018-06-16 04:42:49 -05:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</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>
|