From cefa691a93aff0a48ebeb136d1d271253894718b Mon Sep 17 00:00:00 2001 From: Tom Hoppe Date: Wed, 27 Jan 2016 13:47:30 -0700 Subject: [PATCH 1/2] Can pass in an optional linkText in the serviceProps --- bsp-share.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/bsp-share.js b/bsp-share.js index aa65d7a..87369de 100644 --- a/bsp-share.js +++ b/bsp-share.js @@ -43,37 +43,43 @@ var module = { 'appId' : '', 'trackingUrl' : '', 'width' : 1000, - 'height' : 400 + 'height' : 400, + 'linkText' : '' }, 'google' : { 'baseUrl' : 'https://plus.google.com/share?', 'trackingUrl' : '', 'width' : 1000, - 'height' : 400 + 'height' : 400, + 'linkText' : '' }, 'linkedin' : { 'baseUrl' : 'https://www.linkedin.com/shareArticle?', 'trackingUrl' : '', 'width' : 1000, - 'height' : 600 + 'height' : 600, + 'linkText' : '' }, 'pinterest' : { 'baseUrl' : 'http://pinterest.com/pin/create/bookmarklet/?', 'trackingUrl' : '', 'width' : 1000, - 'height' : 400 + 'height' : 400, + 'linkText' : '' }, 'tumblr' : { 'baseUrl' : 'https://www.tumblr.com/share?', 'trackingUrl' : '', 'width' : 1000, - 'height' : 400 + 'height' : 400, + 'linkText' : '' }, 'twitter' : { 'baseUrl' : 'https://twitter.com/intent/tweet?', 'trackingUrl' : '', 'width' : 1000, - 'height' : 300 + 'height' : 300, + 'linkText' : '' } }, @@ -135,6 +141,7 @@ var module = { $shareLink.attr('href', self._createShareURL(currentService)); $shareLink.attr('target', '_blank'); $shareLink.attr('title', self.options.sharingText + ' ' + currentService); + $shareLink.html(self.options.serviceProps[currentService].linkText); $shareLink.appendTo(self.$el.find('.' + self.options.serviceClassBefore + currentService + self.options.serviceClassAfter)); } From 0846602c1f76270fc95dc711aa898a8c54bc6f14 Mon Sep 17 00:00:00 2001 From: Tom Hoppe Date: Wed, 27 Jan 2016 13:48:31 -0700 Subject: [PATCH 2/2] documentation --- bsp-share.js | 1 + 1 file changed, 1 insertion(+) diff --git a/bsp-share.js b/bsp-share.js index 87369de..f4c9f0b 100644 --- a/bsp-share.js +++ b/bsp-share.js @@ -10,6 +10,7 @@ * 1) You can leave off any services if you do not want those. * 2) You also need to pass in the facebook app id. * 3) The plugin also drops on an icon class for you, so if you are not using the default 'fa' class, you will want to pass in an override + * 4) Lastly, if you need link text vs just an icon, you can pass in an optional linkText in each of the serviceProps throught the data-bsp-share-options pattern * *
*