Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sharon

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sharon - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

CHANGELOG.md

2

core/href-factory.js

@@ -24,4 +24,4 @@ var merge = require('./merge');

return base + '?' + query.join('&');
return base + (~base.indexOf('?') ? '&' : '?') + query.join('&'); // eslint-disable-line no-implicit-coercion
};
};

@@ -1,2 +0,2 @@

var sharon=function(){"use strict";var t=0,n=function(n,e){function r(){document.head.removeChild(i),delete window[o]}var o="j"+t++,i=document.createElement("script");i.src=n+(~n.indexOf("?")?"&":"?")+"callback="+o,i.onerror=function(){r(),e(Error())},window[o]=function(t){r(),e(null,t)},document.head.appendChild(i)},e=n,r=function(t,n){return function(r,o){arguments.length<2&&(o=r,r=location),e(t+"="+encodeURIComponent(r),function(t,e){return t?o(t):void o(null,n(e))})}},o=function(t,n){return n&&Object.keys(n).forEach(function(e){t[e]=n[e]}),t},i=o,u=function(t,n){return n=n||{},function(e,r){return"string"==typeof e?r=i({url:e},r):(r=i({url:location},e),n.title&&(r.title=r.title||document.title)),t+"?"+Object.keys(r).map(function(t){var e=n[t]||t;return Array.isArray(r[t])?e+"="+r[t].map(encodeURIComponent):e+"="+encodeURIComponent(r[t])}).join("&")}},c=function(t,n,e){function r(){var r=t.apply(this,arguments),o=Math.max(0,Math.round((screen.height-e)/2)),i=Math.round((screen.width-n)/2);window.open(r,null,"width="+n+",height="+e+",top="+o+",left="+i+",location,resizable,scrollbars,toolbar=no")}return r.href=t,r},s=r,a=u,l=c,p=a("https://bufferapp.com/add",{title:"text"}),h=l(p,850,600),f=s("https://api.bufferapp.com/1/links/shares.json?url",function(t){return t.shares});h.count=f;var d=r,m=u,w=c,b=m("https://www.facebook.com/sharer.php",{url:"u"}),v=w(b,670,340),g=d("https://graph.facebook.com/?id",function(t){return t.share?t.share.share_count:0});v.count=g;var k=r,x=u,y=c,j=x("https://www.linkedin.com/shareArticle",{title:"title"}),C=y(j,600,400),U=k("https://www.linkedin.com/countserv/count/share?url",function(t){return t.count});C.count=U;var A=r,E=u,I=c,M=E("https://pinterest.com/pin/create/button",{title:"description"}),O=I(M,750,320),R=A("https://api.pinterest.com/v1/urls/count.json?url",function(t){return t.count});O.count=R;var _=r,z=u,N=c,q=z("https://plus.google.com/share"),B=N(q,600,600),D=_("https://share.yandex.ru/gpp.xml?url",Number);B.count=D;var F=r,G=u,H=c,J=G("https://www.tumblr.com/widgets/share/tool",{title:"title",url:"canonicalUrl"}),K=H(J,557,600),L=F("https://api.tumblr.com/v2/share/stats?url",function(t){return t.response.note_count});return K.count=L,{buffer:h,facebook:v,linkedin:C,pinterest:O,plus:B,tumblr:K,twitter:c(u("https://twitter.com/intent/tweet",{title:"text"}),550,420),xing:c(u("https://www.xing.com/spi/shares/new"),570,530)}}();
var sharon=function(){"use strict";var t=0,n=function(n,e){function r(){document.head.removeChild(i),delete window[o]}var o="j"+t++,i=document.createElement("script");i.src=n+(~n.indexOf("?")?"&":"?")+"callback="+o,i.onerror=function(){r(),e(Error())},window[o]=function(t){r(),e(null,t)},document.head.appendChild(i)},e=n,r=function(t,n){return function(r,o){arguments.length<2&&(o=r,r=location),e(t+"="+encodeURIComponent(r),function(t,e){return t?o(t):void o(null,n(e))})}},o=function(t,n){return n&&Object.keys(n).forEach(function(e){t[e]=n[e]}),t},i=o,u=function(t,n){return n=n||{},function(e,r){"string"==typeof e?r=i({url:e},r):(r=i({url:location},e),n.title&&(r.title=r.title||document.title));var o=Object.keys(r).map(function(t){var e=n[t]||t;return Array.isArray(r[t])?e+"="+r[t].map(encodeURIComponent):e+"="+encodeURIComponent(r[t])});return t+(~t.indexOf("?")?"&":"?")+o.join("&")}},c=function(t,n,e){function r(){var r=t.apply(this,arguments),o=Math.max(0,Math.round((screen.height-e)/2)),i=Math.round((screen.width-n)/2);window.open(r,null,"width="+n+",height="+e+",top="+o+",left="+i+",location,resizable,scrollbars,toolbar=no")}return r.href=t,r},a=r,l=u,s=c,p=l("https://bufferapp.com/add",{title:"text"}),h=s(p,850,600),f=a("https://api.bufferapp.com/1/links/shares.json?url",function(t){return t.shares});h.count=f;var m=r,d=u,w=c,b=d("https://www.facebook.com/sharer.php",{url:"u"}),v=w(b,670,340),g=m("https://graph.facebook.com/?id",function(t){return t.share?t.share.share_count:0});v.count=g;var k=u,x=c,y=k("https://mail.google.com/mail/?view=cm",{title:"su",url:"body"}),j=x(y,800,632),C=r,O=u,U=c,A=O("https://www.linkedin.com/shareArticle",{title:"title"}),E=U(A,600,400),I=C("https://www.linkedin.com/countserv/count/share?url",function(t){return t.count});E.count=I;var M=r,R=u,_=c,z=R("https://pinterest.com/pin/create/button",{title:"description"}),N=_(z,750,320),q=M("https://api.pinterest.com/v1/urls/count.json?url",function(t){return t.count});N.count=q;var B=r,D=u,F=c,G=D("https://plus.google.com/share"),H=F(G,600,600),J=B("https://share.yandex.ru/gpp.xml?url",Number);H.count=J;var K=r,L=u,P=c,Q=L("https://www.tumblr.com/widgets/share/tool",{title:"title",url:"canonicalUrl"}),S=P(Q,557,600),T=K("https://api.tumblr.com/v2/share/stats?url",function(t){return t.response.note_count});return S.count=T,{buffer:h,facebook:v,gmail:j,linkedin:E,pinterest:N,plus:H,tumblr:S,twitter:c(u("https://twitter.com/intent/tweet",{title:"text"}),550,420),xing:c(u("https://www.xing.com/spi/shares/new"),570,530)}}();
//# sourceMappingURL=sharon.min.js.map
module.exports = {
buffer: require('./buffer'),
facebook: require('./facebook'),
gmail: require('./gmail'),
linkedin: require('./linkedin'),

@@ -5,0 +6,0 @@ pinterest: require('./pinterest'),

{
"name": "sharon",
"version": "1.0.0",
"version": "1.1.0",
"description": "A lightweight and modular social sharing library",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -8,8 +8,24 @@ [![Sauce Test Status][saucelabs-badge]][saucelabs]

- a toolkit to build your own share buttons;
- opens share popups;
- counts the number of shares;
- supports 8 social networks;
- gzipped size is 1.15 KB;
- supports 9 sharing platforms;
- gzipped size is 1.21 KB;
- you can cherry-pick which social networks to use to make it even smaller.
Here how it looks when you want Sharon to open a tweet popup:
```js
sharon.twitter({
title: 'One last quarter as defending champs!',
hashtags: ['SuperBowl', 'DenverBroncos']
});
```
Or to get a Facebook share count for your page:
```js
sharon.facebook.count(function (err, count) {
if (err) throw err;
console.log('Whoa, we have ' + count + ' shares!');
});
```
## Table of contents

@@ -26,3 +42,3 @@

- [Share parameters](#share-parameters)
- [Examples](#examples)
- [More examples](#more-examples)
- [Poor man&apos;s tweet button](#poor-mans-tweet-button)

@@ -63,3 +79,3 @@ - [Angular](#angular)

- [Production version][download] – 1.15 KB, minified and gzipped
- [Production version][download] – 1.21 KB, minified and gzipped
- [Source map][download-map]

@@ -78,2 +94,3 @@

| Google+ | `sharon.plus` | Yes | [Reference][params-plus] |
| Gmail | `sharon.gmail` | | |
| LinkedIn | `sharon.linkedin` | Yes | [Reference][params-linkedin] |

@@ -205,3 +222,3 @@ | Pinterest | `sharon.pinterest` | Yes | [Reference][params-pinterest] |

## Examples
## More examples

@@ -264,7 +281,7 @@ ### Poor man&apos;s tweet button

[download]: https://github.com/borodean/sharon/releases/download/1.0.0/sharon-1.0.0.min.js
[download-map]: https://github.com/borodean/sharon/releases/download/1.0.0/sharon-1.0.0.min.js.map
[download]: https://github.com/borodean/sharon/releases/download/1.1.0/sharon-1.1.0.min.js
[download-map]: https://github.com/borodean/sharon/releases/download/1.1.0/sharon-1.1.0.min.js.map
[media-example]: media/example.png
[media-heart]: https://cdn.rawgit.com/borodean/sharon/1.0.0/media/heart.svg
[media-sharon]: https://cdn.rawgit.com/borodean/sharon/1.0.0/media/sharon.svg
[media-heart]: https://cdn.rawgit.com/borodean/sharon/1.1.0/media/heart.svg
[media-sharon]: https://cdn.rawgit.com/borodean/sharon/1.1.0/media/sharon.svg
[params-buffer]: https://buffer.com/extras/button

@@ -271,0 +288,0 @@ [params-linkedin]: https://developer.linkedin.com/docs/share-on-linkedin

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc