From 6be434b84e82adc4d3654f3f93931fab559635c3 Mon Sep 17 00:00:00 2001 From: nicolasbeauvais Date: Wed, 30 Aug 2017 21:50:58 +0200 Subject: [PATCH] Add Email --- CHANGELOG.md | 4 +++ README.md | 5 +++- bower.json | 2 +- dist/vue-social-sharing.common.js | 24 +++++++++-------- dist/vue-social-sharing.js | 24 +++++++++-------- dist/vue-social-sharing.min.js | 4 +-- examples/vue2-example.html | 5 ++++ package.json | 2 +- src/index.js | 2 +- src/networks.json | 45 +++++++++++++++++-------------- 10 files changed, 69 insertions(+), 48 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebf0ebe..f5609c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ + +# [2.2.5](https://github.com/nicolasbeauvais/vue-social-sharing/compare/2.2.4...2.2.5) (2017-08-30) +- Add Email + # [2.2.4](https://github.com/nicolasbeauvais/vue-social-sharing/compare/2.2.3...2.2.4) (2017-08-26) - Add Odnoklassniki diff --git a/README.md b/README.md index b87bea1..4cbef98 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # vue-social-sharing - + --- @@ -55,6 +55,9 @@ Vue.use(SocialSharing); ```html
+ + Email + Facebook diff --git a/bower.json b/bower.json index a397651..7495d7b 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "vue-social-sharing", - "version": "2.2.4", + "version": "2.2.5", "homepage": "https://github.com/nicolasbeauvais/vue-social-sharing", "authors": [ "nicolasbeauvais " diff --git a/dist/vue-social-sharing.common.js b/dist/vue-social-sharing.common.js index 6acf45f..bc3e2f0 100644 --- a/dist/vue-social-sharing.common.js +++ b/dist/vue-social-sharing.common.js @@ -1,37 +1,39 @@ /*! - * vue-social-sharing v2.2.4 + * vue-social-sharing v2.2.5 * (c) 2017 nicolasbeauvais * Released under the MIT License. */ 'use strict'; +var email = {"sharer":"mailto:?subject=@title&body=@description","type":"direct"}; var facebook = {"sharer":"https://www.facebook.com/sharer/sharer.php?u=@url&title=@title&description=@description"e=@quote","type":"popup"}; var googleplus = {"sharer":"https://plus.google.com/share?url=@url","type":"popup"}; +var line = {"sharer":"http://line.me/R/msg/text/?@description%0D%0A@url","type":"popup"}; var linkedin = {"sharer":"https://www.linkedin.com/shareArticle?mini=true&url=@url&title=@title&summary=@description","type":"popup"}; +var odnoklassniki = {"sharer":"https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=@url&st.comments=@description","type":"popup"}; var pinterest = {"sharer":"https://pinterest.com/pin/create/button/?url=@url&media=@media&description=@title","type":"popup"}; var reddit = {"sharer":"https://www.reddit.com/submit?url=@url&title=@title","type":"popup"}; +var skype = {"sharer":"https://web.skype.com/share?url=@description%0D%0A@url","type":"popup"}; +var telegram = {"sharer":"https://t.me/share/url?url=@url&text=@description","type":"popup"}; var twitter = {"sharer":"https://twitter.com/intent/tweet?text=@title&url=@url&hashtags=@hashtags@twitteruser","type":"popup"}; var vk = {"sharer":"https://vk.com/share.php?url=@url&title=@title&description=@description&image=@media&noparse=true","type":"popup"}; var weibo = {"sharer":"http://service.weibo.com/share/share.php?url=@url&title=@title","type":"popup"}; var whatsapp = {"sharer":"whatsapp://send?text=@description%0D%0A@url","type":"direct","action":"share/whatsapp/share"}; -var telegram = {"sharer":"https://t.me/share/url?url=@url&text=@description","type":"popup"}; -var line = {"sharer":"http://line.me/R/msg/text/?@description%0D%0A@url","type":"popup"}; -var skype = {"sharer":"https://web.skype.com/share?url=@description%0D%0A@url","type":"popup"}; -var odnoklassniki = {"sharer":"https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=@url&st.comments=@description","type":"popup"}; var Networks = { + email: email, facebook: facebook, googleplus: googleplus, + line: line, linkedin: linkedin, + odnoklassniki: odnoklassniki, pinterest: pinterest, reddit: reddit, + skype: skype, + telegram: telegram, twitter: twitter, vk: vk, weibo: weibo, - whatsapp: whatsapp, - telegram: telegram, - line: line, - skype: skype, - odnoklassniki: odnoklassniki + whatsapp: whatsapp }; var SocialSharingNetwork = { @@ -308,7 +310,7 @@ var SocialSharing = { } }; -SocialSharing.version = '2.2.4'; +SocialSharing.version = '2.2.5'; SocialSharing.install = function (Vue) { Vue.component('social-sharing', SocialSharing); diff --git a/dist/vue-social-sharing.js b/dist/vue-social-sharing.js index 22c1af4..91913aa 100644 --- a/dist/vue-social-sharing.js +++ b/dist/vue-social-sharing.js @@ -1,5 +1,5 @@ /*! - * vue-social-sharing v2.2.4 + * vue-social-sharing v2.2.5 * (c) 2017 nicolasbeauvais * Released under the MIT License. */ @@ -9,33 +9,35 @@ (global.VueSocialSharing = factory()); }(this, (function () { 'use strict'; +var email = {"sharer":"mailto:?subject=@title&body=@description","type":"direct"}; var facebook = {"sharer":"https://www.facebook.com/sharer/sharer.php?u=@url&title=@title&description=@description"e=@quote","type":"popup"}; var googleplus = {"sharer":"https://plus.google.com/share?url=@url","type":"popup"}; +var line = {"sharer":"http://line.me/R/msg/text/?@description%0D%0A@url","type":"popup"}; var linkedin = {"sharer":"https://www.linkedin.com/shareArticle?mini=true&url=@url&title=@title&summary=@description","type":"popup"}; +var odnoklassniki = {"sharer":"https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=@url&st.comments=@description","type":"popup"}; var pinterest = {"sharer":"https://pinterest.com/pin/create/button/?url=@url&media=@media&description=@title","type":"popup"}; var reddit = {"sharer":"https://www.reddit.com/submit?url=@url&title=@title","type":"popup"}; +var skype = {"sharer":"https://web.skype.com/share?url=@description%0D%0A@url","type":"popup"}; +var telegram = {"sharer":"https://t.me/share/url?url=@url&text=@description","type":"popup"}; var twitter = {"sharer":"https://twitter.com/intent/tweet?text=@title&url=@url&hashtags=@hashtags@twitteruser","type":"popup"}; var vk = {"sharer":"https://vk.com/share.php?url=@url&title=@title&description=@description&image=@media&noparse=true","type":"popup"}; var weibo = {"sharer":"http://service.weibo.com/share/share.php?url=@url&title=@title","type":"popup"}; var whatsapp = {"sharer":"whatsapp://send?text=@description%0D%0A@url","type":"direct","action":"share/whatsapp/share"}; -var telegram = {"sharer":"https://t.me/share/url?url=@url&text=@description","type":"popup"}; -var line = {"sharer":"http://line.me/R/msg/text/?@description%0D%0A@url","type":"popup"}; -var skype = {"sharer":"https://web.skype.com/share?url=@description%0D%0A@url","type":"popup"}; -var odnoklassniki = {"sharer":"https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=@url&st.comments=@description","type":"popup"}; var Networks = { + email: email, facebook: facebook, googleplus: googleplus, + line: line, linkedin: linkedin, + odnoklassniki: odnoklassniki, pinterest: pinterest, reddit: reddit, + skype: skype, + telegram: telegram, twitter: twitter, vk: vk, weibo: weibo, - whatsapp: whatsapp, - telegram: telegram, - line: line, - skype: skype, - odnoklassniki: odnoklassniki + whatsapp: whatsapp }; var SocialSharingNetwork = { @@ -312,7 +314,7 @@ var SocialSharing = { } }; -SocialSharing.version = '2.2.4'; +SocialSharing.version = '2.2.5'; SocialSharing.install = function (Vue) { Vue.component('social-sharing', SocialSharing); diff --git a/dist/vue-social-sharing.min.js b/dist/vue-social-sharing.min.js index 0b22d40..0a041e2 100644 --- a/dist/vue-social-sharing.min.js +++ b/dist/vue-social-sharing.min.js @@ -1,6 +1,6 @@ /*! - * vue-social-sharing v2.2.4 + * vue-social-sharing v2.2.5 * (c) 2017 nicolasbeauvais * Released under the MIT License. */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueSocialSharing=e()}(this,function(){"use strict";var t={sharer:"https://www.facebook.com/sharer/sharer.php?u=@url&title=@title&description=@description"e=@quote",type:"popup"},e={sharer:"https://plus.google.com/share?url=@url",type:"popup"},p={sharer:"https://www.linkedin.com/shareArticle?mini=true&url=@url&title=@title&summary=@description",type:"popup"},i={sharer:"https://pinterest.com/pin/create/button/?url=@url&media=@media&description=@title",type:"popup"},r={sharer:"https://www.reddit.com/submit?url=@url&title=@title",type:"popup"},o={sharer:"https://twitter.com/intent/tweet?text=@title&url=@url&hashtags=@hashtags@twitteruser",type:"popup"},n={sharer:"https://vk.com/share.php?url=@url&title=@title&description=@description&image=@media&noparse=true",type:"popup"},s={sharer:"http://service.weibo.com/share/share.php?url=@url&title=@title",type:"popup"},a={sharer:"whatsapp://send?text=@description%0D%0A@url",type:"direct",action:"share/whatsapp/share"},l={sharer:"https://t.me/share/url?url=@url&text=@description",type:"popup"},u={sharer:"http://line.me/R/msg/text/?@description%0D%0A@url",type:"popup"},h={sharer:"https://web.skype.com/share?url=@description%0D%0A@url",type:"popup"},c={sharer:"https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=@url&st.comments=@description",type:"popup"},d={facebook:t,googleplus:e,linkedin:p,pinterest:i,reddit:r,twitter:o,vk:n,weibo:s,whatsapp:a,telegram:l,line:u,skype:h,odnoklassniki:c},w={functional:!0,props:{network:{type:String,default:""}},render:function(t,e){var p=d[e.props.network];return t(e.parent.networkTag,{class:e.data.staticClass||null,style:e.data.staticStyle||null,attrs:{id:e.data.attrs.id||null,"data-link":"popup"===p.type?"#share-"+e.props.network:e.parent.createSharingUrl(e.props.network),"data-action":"popup"===p.type?null:p.action},on:{click:"popup"===p.type?function(){e.parent.share(e.props.network)}:function(){e.parent.touch(e.props.network)}}},e.children)}},m="undefined"!=typeof window,g=m?window:null,f={props:{url:{type:String,default:m?window.location.href:""},title:{type:String,default:""},description:{type:String,default:""},quote:{type:String,default:""},hashtags:{type:String,default:""},twitterUser:{type:String,default:""},withCounts:{type:[String,Boolean],default:!1},googleKey:{type:String,default:void 0},media:{type:String,default:""},networkTag:{type:String,default:"span"}},data:function(){return{networks:d,popup:{status:!1,resizable:!0,toolbar:!1,menubar:!1,scrollbars:!1,location:!1,directories:!1,width:626,height:436,top:0,left:0,window:void 0,interval:null}}},methods:{createSharingUrl:function(t){return this.networks[t].sharer.replace(/@url/g,encodeURIComponent(this.url)).replace(/@title/g,encodeURIComponent(this.title)).replace(/@description/g,encodeURIComponent(this.description)).replace(/@quote/g,encodeURIComponent(this.quote)).replace(/@hashtags/g,this.hashtags).replace(/@media/g,this.media).replace(/@twitteruser/g,this.twitterUser?"&via="+this.twitterUser:"")},share:function(t){this.openSharer(t,this.createSharingUrl(t)),this.$root.$emit("social_shares_open",t,this.url)},touch:function(t){window.open(this.createSharingUrl(t),"_self"),this.$root.$emit("social_shares_open",t,this.url)},openSharer:function(t,e){var p=this;this.popup.window&&this.popup.interval&&(clearInterval(this.popup.interval),this.popup.window.close(),this.$root.$emit("social_shares_change",t,this.url)),this.popup.window=window.open(e,"sharer","status="+(this.popup.status?"yes":"no")+",height="+this.popup.height+",width="+this.popup.width+",resizable="+(this.popup.resizable?"yes":"no")+",left="+this.popup.left+",top="+this.popup.top+",screenX="+this.popup.left+",screenY="+this.popup.top+",toolbar="+(this.popup.toolbar?"yes":"no")+",menubar="+(this.popup.menubar?"yes":"no")+",scrollbars="+(this.popup.scrollbars?"yes":"no")+",location="+(this.popup.location?"yes":"no")+",directories="+(this.popup.directories?"yes":"no")),this.popup.window.focus(),this.popup.interval=setInterval(function(){p.popup.window.closed&&(clearInterval(p.popup.interval),p.popup.window=void 0,p.$root.$emit("social_shares_close",t,p.url))},500)}},mounted:function(){if(m){var t=void 0!==g.screenLeft?g.screenLeft:screen.left,e=void 0!==g.screenTop?g.screenTop:screen.top,p=g.innerWidth?g.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,i=g.innerHeight?g.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height;this.popup.left=p/2-this.popup.width/2+t,this.popup.top=i/2-this.popup.height/2+e}},components:{network:w}};return f.version="2.2.4",f.install=function(t){t.component("social-sharing",f)},"undefined"!=typeof window&&(window.SocialSharing=f),f}); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueSocialSharing=e()}(this,function(){"use strict";var t={sharer:"mailto:?subject=@title&body=@description",type:"direct"},e={sharer:"https://www.facebook.com/sharer/sharer.php?u=@url&title=@title&description=@description"e=@quote",type:"popup"},i={sharer:"https://plus.google.com/share?url=@url",type:"popup"},r={sharer:"http://line.me/R/msg/text/?@description%0D%0A@url",type:"popup"},p={sharer:"https://www.linkedin.com/shareArticle?mini=true&url=@url&title=@title&summary=@description",type:"popup"},o={sharer:"https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=@url&st.comments=@description",type:"popup"},n={sharer:"https://pinterest.com/pin/create/button/?url=@url&media=@media&description=@title",type:"popup"},s={sharer:"https://www.reddit.com/submit?url=@url&title=@title",type:"popup"},a={sharer:"https://web.skype.com/share?url=@description%0D%0A@url",type:"popup"},l={sharer:"https://t.me/share/url?url=@url&text=@description",type:"popup"},u={sharer:"https://twitter.com/intent/tweet?text=@title&url=@url&hashtags=@hashtags@twitteruser",type:"popup"},h={sharer:"https://vk.com/share.php?url=@url&title=@title&description=@description&image=@media&noparse=true",type:"popup"},c={sharer:"http://service.weibo.com/share/share.php?url=@url&title=@title",type:"popup"},d={sharer:"whatsapp://send?text=@description%0D%0A@url",type:"direct",action:"share/whatsapp/share"},w={email:t,facebook:e,googleplus:i,line:r,linkedin:p,odnoklassniki:o,pinterest:n,reddit:s,skype:a,telegram:l,twitter:u,vk:h,weibo:c,whatsapp:d},m={functional:!0,props:{network:{type:String,default:""}},render:function(t,e){var i=w[e.props.network];return t(e.parent.networkTag,{class:e.data.staticClass||null,style:e.data.staticStyle||null,attrs:{id:e.data.attrs.id||null,"data-link":"popup"===i.type?"#share-"+e.props.network:e.parent.createSharingUrl(e.props.network),"data-action":"popup"===i.type?null:i.action},on:{click:"popup"===i.type?function(){e.parent.share(e.props.network)}:function(){e.parent.touch(e.props.network)}}},e.children)}},g="undefined"!=typeof window,f=g?window:null,y={props:{url:{type:String,default:g?window.location.href:""},title:{type:String,default:""},description:{type:String,default:""},quote:{type:String,default:""},hashtags:{type:String,default:""},twitterUser:{type:String,default:""},withCounts:{type:[String,Boolean],default:!1},googleKey:{type:String,default:void 0},media:{type:String,default:""},networkTag:{type:String,default:"span"}},data:function(){return{networks:w,popup:{status:!1,resizable:!0,toolbar:!1,menubar:!1,scrollbars:!1,location:!1,directories:!1,width:626,height:436,top:0,left:0,window:void 0,interval:null}}},methods:{createSharingUrl:function(t){return this.networks[t].sharer.replace(/@url/g,encodeURIComponent(this.url)).replace(/@title/g,encodeURIComponent(this.title)).replace(/@description/g,encodeURIComponent(this.description)).replace(/@quote/g,encodeURIComponent(this.quote)).replace(/@hashtags/g,this.hashtags).replace(/@media/g,this.media).replace(/@twitteruser/g,this.twitterUser?"&via="+this.twitterUser:"")},share:function(t){this.openSharer(t,this.createSharingUrl(t)),this.$root.$emit("social_shares_open",t,this.url)},touch:function(t){window.open(this.createSharingUrl(t),"_self"),this.$root.$emit("social_shares_open",t,this.url)},openSharer:function(t,e){var i=this;this.popup.window&&this.popup.interval&&(clearInterval(this.popup.interval),this.popup.window.close(),this.$root.$emit("social_shares_change",t,this.url)),this.popup.window=window.open(e,"sharer","status="+(this.popup.status?"yes":"no")+",height="+this.popup.height+",width="+this.popup.width+",resizable="+(this.popup.resizable?"yes":"no")+",left="+this.popup.left+",top="+this.popup.top+",screenX="+this.popup.left+",screenY="+this.popup.top+",toolbar="+(this.popup.toolbar?"yes":"no")+",menubar="+(this.popup.menubar?"yes":"no")+",scrollbars="+(this.popup.scrollbars?"yes":"no")+",location="+(this.popup.location?"yes":"no")+",directories="+(this.popup.directories?"yes":"no")),this.popup.window.focus(),this.popup.interval=setInterval(function(){i.popup.window.closed&&(clearInterval(i.popup.interval),i.popup.window=void 0,i.$root.$emit("social_shares_close",t,i.url))},500)}},mounted:function(){if(g){var t=void 0!==f.screenLeft?f.screenLeft:screen.left,e=void 0!==f.screenTop?f.screenTop:screen.top,i=f.innerWidth?f.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,r=f.innerHeight?f.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height;this.popup.left=i/2-this.popup.width/2+t,this.popup.top=r/2-this.popup.height/2+e}},components:{network:m}};return y.version="2.2.5",y.install=function(t){t.component("social-sharing",y)},"undefined"!=typeof window&&(window.SocialSharing=y),y}); \ No newline at end of file diff --git a/examples/vue2-example.html b/examples/vue2-example.html index 43a3bf6..23c9202 100644 --- a/examples/vue2-example.html +++ b/examples/vue2-example.html @@ -30,6 +30,11 @@ v-cloak inline-template>
    +
  • + + Email + +
  • Facebook diff --git a/package.json b/package.json index 0359029..85370d0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vue-social-sharing", "description": "A Vue.js component for sharing links to social networks", - "version": "2.2.4", + "version": "2.2.5", "author": { "name": "nicolasbeauvais", "email": "nicolasbeauvais1@gmail.com" diff --git a/src/index.js b/src/index.js index 680615b..d669076 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,6 @@ import SocialSharing from './social-sharing'; -SocialSharing.version = '2.2.4'; +SocialSharing.version = '2.2.5'; SocialSharing.install = (Vue) => { Vue.component('social-sharing', SocialSharing); diff --git a/src/networks.json b/src/networks.json index afa218c..c67d06b 100644 --- a/src/networks.json +++ b/src/networks.json @@ -1,4 +1,9 @@ { + "email": { + "sharer": "mailto:?subject=@title&body=@description", + "type": "direct" + }, + "facebook": { "sharer": "https://www.facebook.com/sharer/sharer.php?u=@url&title=@title&description=@description"e=@quote", "type": "popup" @@ -9,11 +14,21 @@ "type": "popup" }, + "line": { + "sharer": "http://line.me/R/msg/text/?@description%0D%0A@url", + "type": "popup" + }, + "linkedin": { "sharer": "https://www.linkedin.com/shareArticle?mini=true&url=@url&title=@title&summary=@description", "type": "popup" }, + "odnoklassniki": { + "sharer": "https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=@url&st.comments=@description", + "type": "popup" + }, + "pinterest": { "sharer": "https://pinterest.com/pin/create/button/?url=@url&media=@media&description=@title", "type": "popup" @@ -24,6 +39,16 @@ "type": "popup" }, + "skype": { + "sharer": "https://web.skype.com/share?url=@description%0D%0A@url", + "type": "popup" + }, + + "telegram": { + "sharer": "https://t.me/share/url?url=@url&text=@description", + "type": "popup" + }, + "twitter": { "sharer": "https://twitter.com/intent/tweet?text=@title&url=@url&hashtags=@hashtags@twitteruser", "type": "popup" @@ -43,25 +68,5 @@ "sharer": "whatsapp://send?text=@description%0D%0A@url", "type": "direct", "action": "share/whatsapp/share" - }, - - "telegram": { - "sharer": "https://t.me/share/url?url=@url&text=@description", - "type": "popup" - }, - - "line": { - "sharer": "http://line.me/R/msg/text/?@description%0D%0A@url", - "type": "popup" - }, - - "skype": { - "sharer": "https://web.skype.com/share?url=@description%0D%0A@url", - "type": "popup" - }, - - "odnoklassniki": { - "sharer": "https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=@url&st.comments=@description", - "type": "popup" } }