mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
356 lines
9.3 KiB
356 lines
9.3 KiB
3 years ago
|
<template>
|
||
|
<div>
|
||
|
<a
|
||
|
v-if="!socialMedias || !socialMedias.length || socialMedias.includes('twitter')"
|
||
3 years ago
|
v-ge="['twitter', '']"
|
||
3 years ago
|
href="#"
|
||
|
:class="iconClass"
|
||
|
class="px-2"
|
||
3 years ago
|
@click.prevent="
|
||
|
openUrl(`https://twitter.com/intent/tweet?url=${shareUrl}&text=${encodedSummary}&hashtags=${hashTags}`)
|
||
|
"
|
||
3 years ago
|
>
|
||
|
<img
|
||
3 years ago
|
src="social/twitter.png"
|
||
3 years ago
|
class="img-responsive"
|
||
|
alt="Twitter"
|
||
|
:width="width"
|
||
|
:style="css"
|
||
|
title="Social Media Share"
|
||
3 years ago
|
/>
|
||
3 years ago
|
</a>
|
||
|
|
||
|
<a
|
||
|
v-if="!socialMedias || !socialMedias.length || socialMedias.includes('linkedin')"
|
||
3 years ago
|
v-ge="['linkedin', '']"
|
||
3 years ago
|
href="#"
|
||
|
:class="iconClass"
|
||
|
class="px-2"
|
||
3 years ago
|
@click.prevent="
|
||
|
openUrl(
|
||
|
`https://www.linkedin.com/shareArticle?mini=true&url=${shareUrl}&title=${encodedTitle}&summary=${encodedSummary}`
|
||
|
)
|
||
|
"
|
||
3 years ago
|
>
|
||
|
<img
|
||
3 years ago
|
src="social/linkedin.png"
|
||
3 years ago
|
class="img-responsive"
|
||
|
alt="Linkedin"
|
||
|
:width="width"
|
||
|
:style="css"
|
||
|
title="Social Media Share"
|
||
3 years ago
|
/>
|
||
3 years ago
|
</a>
|
||
|
|
||
|
<a
|
||
|
v-if="!socialMedias || !socialMedias.length || socialMedias.includes('facebook')"
|
||
3 years ago
|
v-ge="['facebook', '']"
|
||
3 years ago
|
href="#"
|
||
|
:class="iconClass"
|
||
|
class="px-2"
|
||
3 years ago
|
@click.prevent="
|
||
|
openUrl(
|
||
|
`https://www.facebook.com/sharer/sharer.php?u=${shareUrl}&title=${encodedTitle}&summary=${encodedSummary}"e=${encodedTitle}&hashtag=${fbHashTags}`
|
||
|
)
|
||
|
"
|
||
3 years ago
|
>
|
||
|
<img
|
||
3 years ago
|
src="social/facebook.png"
|
||
3 years ago
|
class="img-responsive"
|
||
|
alt="Facebook"
|
||
|
:width="width"
|
||
|
:style="css"
|
||
|
title="Social Media Share"
|
||
3 years ago
|
/>
|
||
3 years ago
|
</a>
|
||
|
|
||
|
<a
|
||
|
v-if="!socialMedias || !socialMedias.length || socialMedias.includes('reddit')"
|
||
3 years ago
|
v-ge="['reddit', '']"
|
||
3 years ago
|
href="#"
|
||
|
:class="iconClass"
|
||
|
class="px-2"
|
||
|
@click.prevent="openUrl(`https://www.reddit.com/submit?url=${shareUrl}&title=${encodedSummary}`)"
|
||
|
>
|
||
|
<img
|
||
3 years ago
|
src="social/reddit.png"
|
||
3 years ago
|
class="img-responsive"
|
||
|
alt="Reddit"
|
||
|
:width="width"
|
||
|
:style="css"
|
||
|
title="Social Media Share"
|
||
3 years ago
|
/>
|
||
3 years ago
|
</a>
|
||
|
|
||
|
<a
|
||
|
v-if="!socialMedias || !socialMedias.length || socialMedias.includes('pinterest')"
|
||
3 years ago
|
v-ge="['pinterest', '']"
|
||
3 years ago
|
href="#"
|
||
|
:class="iconClass"
|
||
|
class="px-2"
|
||
3 years ago
|
@click.prevent="
|
||
|
openUrl(`https://pinterest.com/pin/create/button/?url=${shareUrl}&description==${encodedSummary}`)
|
||
|
"
|
||
3 years ago
|
>
|
||
|
<img
|
||
3 years ago
|
src="social/pinterest.png"
|
||
3 years ago
|
class="img-responsive"
|
||
|
alt="Printrest"
|
||
|
:width="width"
|
||
|
:style="css"
|
||
|
title="Social Media Share"
|
||
3 years ago
|
/>
|
||
3 years ago
|
</a>
|
||
|
|
||
|
<a
|
||
|
v-if="!socialMedias || !socialMedias.length || socialMedias.includes('whatsapp')"
|
||
3 years ago
|
v-ge="['whatsapp', '']"
|
||
3 years ago
|
href="#"
|
||
|
:class="iconClass"
|
||
|
class="px-2"
|
||
|
@click.prevent="openUrl(`https://api.whatsapp.com/send?text=${encodedSummary}%0D%0A${shareUrl}`)"
|
||
|
>
|
||
|
<img
|
||
3 years ago
|
src="social/whatsapp.png"
|
||
3 years ago
|
class="img-responsive"
|
||
|
alt="Whatsapp"
|
||
|
:width="width"
|
||
|
:style="css"
|
||
|
title="Social Media Share"
|
||
3 years ago
|
/>
|
||
3 years ago
|
</a>
|
||
|
<a
|
||
|
v-if="!socialMedias || !socialMedias.length || socialMedias.includes('telegram')"
|
||
3 years ago
|
v-ge="['telegram', '']"
|
||
3 years ago
|
href="#"
|
||
|
:class="iconClass"
|
||
|
class="px-2"
|
||
|
@click.prevent="openUrl(`https://telegram.me/share/url?url=${shareUrl}&text=${encodedSummary}`)"
|
||
|
>
|
||
|
<img
|
||
3 years ago
|
src="social/png/telegram.png"
|
||
3 years ago
|
class="img-responsive"
|
||
|
alt="Telegram"
|
||
|
:width="width"
|
||
|
:style="css"
|
||
|
title="Social Media Share"
|
||
3 years ago
|
/>
|
||
3 years ago
|
</a>
|
||
|
<a
|
||
|
v-if="!socialMedias || !socialMedias.length || socialMedias.includes('wechat')"
|
||
3 years ago
|
v-ge="['wechat', '']"
|
||
3 years ago
|
:class="iconClass"
|
||
|
class="px-2"
|
||
|
@click.prevent="openUrl(`https://www.addtoany.com/add_to/wechat?linkurl=${shareUrl}&linkname=${encodedTitle}`)"
|
||
|
>
|
||
|
<img
|
||
3 years ago
|
src="social/png/wechat.png"
|
||
3 years ago
|
class="img-responsive"
|
||
|
alt="Wechat"
|
||
|
:width="width"
|
||
|
:style="css"
|
||
|
title="Social Media Share"
|
||
3 years ago
|
/>
|
||
3 years ago
|
</a>
|
||
|
<a
|
||
|
v-if="!socialMedias || !socialMedias.length || socialMedias.includes('line')"
|
||
3 years ago
|
v-ge="['line', '']"
|
||
3 years ago
|
href="#"
|
||
|
:class="iconClass"
|
||
|
class="px-2"
|
||
|
>
|
||
|
<img
|
||
3 years ago
|
src="social/png/line.png"
|
||
3 years ago
|
class="img-responsive"
|
||
|
alt="Line"
|
||
|
:width="width"
|
||
|
:style="css"
|
||
|
title="Social Media Share"
|
||
|
@click.prevent="openUrl(`http://line.me/R/msg/text/?${encodedTitle}%0D%0A${shareUrl}`)"
|
||
3 years ago
|
/>
|
||
3 years ago
|
</a>
|
||
|
<a
|
||
|
v-if="!socialMedias || !socialMedias.length || socialMedias.includes('odnoklassniki')"
|
||
3 years ago
|
v-ge="['odnoklassniki', '']"
|
||
3 years ago
|
href="#"
|
||
|
:class="iconClass"
|
||
|
class="px-2"
|
||
|
>
|
||
|
<img
|
||
3 years ago
|
src="social/png/odnoklassniki.png"
|
||
3 years ago
|
class="img-responsive"
|
||
|
alt="Odnoklassniki"
|
||
|
:width="width"
|
||
|
:style="css"
|
||
|
title="Social Media Share"
|
||
3 years ago
|
@click.prevent="
|
||
|
openUrl(
|
||
|
`https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=${shareUrl}&st.comments=${encodedSummary}`
|
||
|
)
|
||
|
"
|
||
|
/>
|
||
3 years ago
|
</a>
|
||
|
<a
|
||
|
v-if="!socialMedias || !socialMedias.length || socialMedias.includes('weibo')"
|
||
3 years ago
|
v-ge="['weibo', '']"
|
||
3 years ago
|
href="#"
|
||
|
:class="iconClass"
|
||
|
class="px-2"
|
||
|
@click.prevent="openUrl(`http://service.weibo.com/share/share.php?url=${shareUrl})&title=${encodedTitle}`)"
|
||
|
>
|
||
|
<img
|
||
3 years ago
|
src="social/png/weibo.png"
|
||
3 years ago
|
class="img-responsive"
|
||
|
alt="Weibo"
|
||
|
:width="width"
|
||
|
:style="css"
|
||
|
title="Social Media Share"
|
||
3 years ago
|
/>
|
||
3 years ago
|
</a>
|
||
|
<a
|
||
|
v-if="!socialMedias || !socialMedias.length || socialMedias.includes('renren')"
|
||
3 years ago
|
v-ge="['renren', '']"
|
||
3 years ago
|
:class="iconClass"
|
||
|
class="px-2"
|
||
3 years ago
|
@click.prevent="
|
||
|
openUrl(
|
||
|
`http://widget.renren.com/dialog/share?resourceUrl=${shareUrl}&srcUrl=${shareUrl}&title=${encodedTitle}&description=${encodedSummary}`
|
||
|
)
|
||
|
"
|
||
3 years ago
|
>
|
||
|
<img
|
||
3 years ago
|
src="social/png/renren.png"
|
||
3 years ago
|
class="img-responsive"
|
||
|
alt="Renren"
|
||
|
:width="width"
|
||
|
:style="css"
|
||
|
title="Social Media Share"
|
||
3 years ago
|
/>
|
||
3 years ago
|
</a>
|
||
|
<a
|
||
|
v-if="!socialMedias || !socialMedias.length || socialMedias.includes('douban')"
|
||
3 years ago
|
v-ge="['douban', '']"
|
||
3 years ago
|
:class="iconClass"
|
||
|
class="px-2"
|
||
|
@click.prevent="openUrl(`http://www.douban.com/recommend/?url=${shareUrl}&title=${encodedTitle}`)"
|
||
|
>
|
||
|
<img
|
||
3 years ago
|
src="social/png/douban.png"
|
||
3 years ago
|
class="img-responsive"
|
||
|
alt="Douban"
|
||
|
:width="width"
|
||
|
:style="css"
|
||
|
title="Social Media Share"
|
||
3 years ago
|
/>
|
||
3 years ago
|
</a>
|
||
|
<a
|
||
|
v-if="!socialMedias || !socialMedias.length || socialMedias.includes('vk')"
|
||
3 years ago
|
v-ge="['vk', '']"
|
||
3 years ago
|
href="#"
|
||
|
:class="iconClass"
|
||
|
class="px-2"
|
||
3 years ago
|
@click.prevent="
|
||
|
openUrl(
|
||
|
`https://vk.com/share.php?url=${shareUrl})&title=${encodedTitle}&description=${encodedSummary}&noparse=true`
|
||
|
)
|
||
|
"
|
||
3 years ago
|
>
|
||
|
<img
|
||
3 years ago
|
src="social/png/vk.png"
|
||
3 years ago
|
class="img-responsive"
|
||
|
alt="VK"
|
||
|
:width="width"
|
||
|
:style="css"
|
||
|
title="Social Media Share"
|
||
3 years ago
|
/>
|
||
3 years ago
|
</a>
|
||
|
<a
|
||
|
v-if="!socialMedias || !socialMedias.length || socialMedias.includes('wykop')"
|
||
3 years ago
|
v-ge="['wykop', '']"
|
||
3 years ago
|
:class="iconClass"
|
||
|
class="px-2"
|
||
|
@click.prevent="openUrl(`https://www.addtoany.com/add_to/wykop?linkurl=${shareUrl}&linkname=${encodedTitle}`)"
|
||
|
>
|
||
|
<img
|
||
3 years ago
|
src="social/png/wykop.jpg"
|
||
3 years ago
|
class="img-responsive"
|
||
|
alt="Wykop"
|
||
|
:width="width"
|
||
|
:style="css"
|
||
|
title="Social Media Share"
|
||
3 years ago
|
/>
|
||
3 years ago
|
</a>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
|
name: 'ShareIcons',
|
||
|
props: {
|
||
|
url: String,
|
||
|
socialMedias: {
|
||
3 years ago
|
type: Array,
|
||
3 years ago
|
},
|
||
|
title: {
|
||
|
default: 'NocoDB',
|
||
3 years ago
|
type: String,
|
||
3 years ago
|
},
|
||
|
summary: {
|
||
3 years ago
|
type: String,
|
||
3 years ago
|
},
|
||
|
hashTags: {
|
||
|
default: '',
|
||
3 years ago
|
type: String,
|
||
3 years ago
|
},
|
||
|
css: {
|
||
3 years ago
|
default: '',
|
||
3 years ago
|
},
|
||
|
width: {
|
||
3 years ago
|
default: '45px',
|
||
3 years ago
|
},
|
||
|
iconClass: {
|
||
3 years ago
|
default: '',
|
||
|
},
|
||
3 years ago
|
},
|
||
|
data() {
|
||
|
return {
|
||
|
summaryArr: [
|
||
|
'Instant #Rest & #GraphQL APIs on any #SQL Database (Supports : MySQL, PostgresSQL, MsSQL, SQLite, MariaDB) #nocodb ',
|
||
|
'Instantly generate #Rest & #GraphQL APIs on any #SQL Database (Supports : MySQL, PostgresSQL, MsSQL, SQLite, MariaDB) #nocodb',
|
||
|
'Instant #serverless Rest & #GraphQL APIs on any Database #nocodb',
|
||
|
'Instant APIs on any SQL Database (Supports : #REST #GraphQL #MySQL, #PostgresSQL, #MsSQL, #SQLite, #MariaDB) #nocodb',
|
||
3 years ago
|
'Generate Instant APIs on any SQL Database (Supports : #REST #GraphQL #MySQL, #PostgresSQL, #MsSQL, #SQLite, #MariaDB) #nocodb',
|
||
|
],
|
||
|
};
|
||
3 years ago
|
},
|
||
|
computed: {
|
||
|
shareUrl() {
|
||
3 years ago
|
return encodeURIComponent(this.url);
|
||
3 years ago
|
},
|
||
|
encodedSummary() {
|
||
3 years ago
|
return ''; // encodeURIComponent(this.summary || this.summaryArr[Math.floor(Math.random() * this.summaryArr.length)])
|
||
3 years ago
|
},
|
||
|
encodedTitle() {
|
||
3 years ago
|
return encodeURIComponent(this.title || 'NocoDB');
|
||
3 years ago
|
},
|
||
|
fbHashTags() {
|
||
3 years ago
|
return this.hashTags && '%23' + this.hashTags;
|
||
|
},
|
||
3 years ago
|
},
|
||
|
methods: {
|
||
|
openUrl(url) {
|
||
3 years ago
|
window.open(url, '_blank');
|
||
|
},
|
||
|
},
|
||
|
};
|
||
3 years ago
|
</script>
|
||
|
|
||
|
<style scoped>
|
||
3 years ago
|
.img-responsive {
|
||
|
width: 30px;
|
||
3 years ago
|
}
|
||
3 years ago
|
.small .img-responsive {
|
||
|
width: 25px;
|
||
3 years ago
|
}
|
||
|
</style>
|