forked from FoundKeyGang/FoundKey
Fix #5856
This commit is contained in:
parent
294c9840de
commit
15a41e31b0
3 changed files with 78 additions and 0 deletions
|
@ -351,6 +351,7 @@ posted: "投稿しました"
|
||||||
autoReloadWhenDisconnected: "サーバー切断時に自動リロード"
|
autoReloadWhenDisconnected: "サーバー切断時に自動リロード"
|
||||||
autoNoteWatch: "ノートの自動ウォッチ"
|
autoNoteWatch: "ノートの自動ウォッチ"
|
||||||
reduceUiAnimation: "UIのアニメーションを減らす"
|
reduceUiAnimation: "UIのアニメーションを減らす"
|
||||||
|
share: "共有"
|
||||||
|
|
||||||
_2fa:
|
_2fa:
|
||||||
registerDevice: "デバイスを登録"
|
registerDevice: "デバイスを登録"
|
||||||
|
|
76
src/client/pages/share.vue
Normal file
76
src/client/pages/share.vue
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
<template>
|
||||||
|
<div class="">
|
||||||
|
<portal to="icon"><fa :icon="faShareAlt"/></portal>
|
||||||
|
<portal to="title">{{ $t('share') }}</portal>
|
||||||
|
|
||||||
|
<section class="_card">
|
||||||
|
<div class="_title" v-if="title">{{ title }}</div>
|
||||||
|
<div class="_content">
|
||||||
|
<div>{{ text }}</div>
|
||||||
|
<mk-button @click="post()">{{ $t('post') }}</mk-button>
|
||||||
|
</div>
|
||||||
|
<div class="_footer" v-if="url">{{ url }}</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import Vue from 'vue';
|
||||||
|
import { faShareAlt } from '@fortawesome/free-solid-svg-icons';
|
||||||
|
import i18n from '../i18n';
|
||||||
|
import PostFormDialog from '../components/post-form-dialog.vue';
|
||||||
|
import MkButton from '../components/ui/button.vue';
|
||||||
|
|
||||||
|
export default Vue.extend({
|
||||||
|
i18n,
|
||||||
|
|
||||||
|
metaInfo() {
|
||||||
|
return {
|
||||||
|
title: this.$t('share') as string
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
components: {
|
||||||
|
MkButton
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: null,
|
||||||
|
text: null,
|
||||||
|
url: null,
|
||||||
|
faShareAlt
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
created() {
|
||||||
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
|
this.title = urlParams.get('title');
|
||||||
|
this.text = urlParams.get('text');
|
||||||
|
this.url = urlParams.get('url');
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.post();
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
post() {
|
||||||
|
let text = '';
|
||||||
|
if (this.title) text += `【${this.title}】\n`;
|
||||||
|
if (this.text) text += `${this.text}\n`;
|
||||||
|
if (this.url) text += `${this.url}`;
|
||||||
|
this.$root.new(PostFormDialog, {
|
||||||
|
instant: true,
|
||||||
|
initialText: text.trim()
|
||||||
|
}).$once('posted', () => {
|
||||||
|
alert('a');
|
||||||
|
window.close();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
</style>
|
|
@ -52,6 +52,7 @@ export const router = new VueRouter({
|
||||||
{ path: '/tags/:tag', component: page('tag') },
|
{ path: '/tags/:tag', component: page('tag') },
|
||||||
{ path: '/auth/:token', component: page('auth') },
|
{ path: '/auth/:token', component: page('auth') },
|
||||||
{ path: '/authorize-follow', component: page('follow') },
|
{ path: '/authorize-follow', component: page('follow') },
|
||||||
|
{ path: '/share', component: page('share') },
|
||||||
/*{ path: '*', component: MkNotFound }*/
|
/*{ path: '*', component: MkNotFound }*/
|
||||||
],
|
],
|
||||||
// なんかHacky
|
// なんかHacky
|
||||||
|
|
Loading…
Reference in a new issue