{"_id":"jquery-socialshare","_rev":"2-5409d814da6be085f2393ab64774ae0b","name":"jquery-socialshare","description":"Minimalist social sharing jQuery plugin, use any styles, themes, buttons or links.","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.3":{"name":"jquery-socialshare","description":"Minimalist social sharing jQuery plugin, use any styles, themes, buttons or links.","version":"1.0.3","license":"MIT","keywords":["jquery","social","share","sharing","flexible","plugin"],"main":"./dist/js/jquery-socialshare.js","files":["dist","docs","src/*.js","LICENSE"],"homepage":"http://pnmcosta.github.io/jquery-socialshare","author":{"name":"Pedro Maia Costa","email":"geral@pmcdigital.pt"},"bugs":{"url":"https://github.com/pnmcosta/jquery-socialshare/issues/"},"repository":{"type":"git","url":"git://github.com/pnmcosta/jquery-socialshare.git"},"peerDependencies":{"jquery":">=1.9.1"},"dependencies":{"jquery":">=1.9.1"},"devDependencies":{"eslint-config-jquery":"1.0.0","grunt":"latest","grunt-banner":"^0.6.0","grunt-contrib-clean":"^1.0.0","grunt-contrib-compress":"^1.4.1","grunt-contrib-concat":"^1.0.1","grunt-contrib-uglify":"^2.2.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"19.0.0","grunt-string-replace":"latest","load-grunt-tasks":"latest","time-grunt":"^1.4.0"},"gitHead":"2e2652129e0f5c07163c8a3a013ad07076adfe11","_id":"jquery-socialshare@1.0.3","scripts":{},"_shasum":"f30bcb016d51b3fcf08a826fa3eef82533775cbe","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"pnmcosta","email":"geral@pmcdigital.pt"},"dist":{"shasum":"f30bcb016d51b3fcf08a826fa3eef82533775cbe","tarball":"https://registry.npmjs.org/jquery-socialshare/-/jquery-socialshare-1.0.3.tgz","integrity":"sha512-1WMpymYUL9/x9jUvcDsEIkJRzb+5Ux8+RH0Dci3YglqsJapW/ZhRmI6gBVNu01erjDJLp26OStrCFQeDBjq+rQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzHCWJ3tDn4l5iE4UJXgYeTo0UiTO8+xN1dLzawmYyMQIhANYoNjkPPbrgLJzcaZxFjP8CkW2fHwheoxtCTPp0isJs"}]},"maintainers":[{"name":"pnmcosta","email":"geral@pmcdigital.pt"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/jquery-socialshare-1.0.3.tgz_1490971539665_0.5095137299504131"}}},"readme":"# jquery-socialshare\r\n\r\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://raw.githubusercontent.com/pnmcosta/jquery-socialshare/master/LICENSE)\r\n\r\nA minimalist social sharing jQuery plugin, use any styles, themes, buttons or links. Includes templates and callbacks for popup `open` and `close` events.\r\n\r\nView the [Online Demo](https://pnmcosta.github.io/jquery-socialshare/), it uses the [Zocial CSS social buttons](http://zocial.smcllns.com/) and [Bootstrap](http://getbootstrap.com) presentation purposes.\r\n\r\nVersions are incremented according to [semver](http://semver.org/).\r\n\r\n## Requirements\r\n- [jQuery](https://jquery.com/) 1.9.1+\r\n\r\n## Why?\r\nBecause I always found it tricky to find the right social sharing plugin for the bespoke websites I develop at my daily job @[PMC-Digital](http://www.pmcdigital.pt/). The existing plugins either relied on their own themes, styling, were hard to customize or heavy!\r\n\r\nI also wanted to get started with [Grunt](https://gruntjs.com/), [Bower](https://bower.io/) and the possibilities of developing with these tools.\r\n\r\n## Installation\r\n\r\nYou can install this package either from a `release` or `bower`.\r\n\r\n### Release\r\nDownload a compressed `*-dist.zip` file from the [Releases Tab](https://github.com/pnmcosta/jquery-socialshare/releases)\r\n\r\n### Bower\r\n```shell\r\nbower install jquery-socialshare --save\r\n```\r\n\r\n## Usage\r\n\r\nInclude a `<script>` on your `html` file:\r\n\r\n```html\r\n<script src=\"/your/path/to/jquery-socialshare.min.js\"></script>\r\n```\r\n\r\nConfigure your links/buttons with a class for the corresponding template:\r\n```html\r\n<div class=\"social-container\">\r\n    <a href=\"#\" class=\"facebook\" aria-label=\"Share this page with Facebook\" role=\"button\">Share on Facebook</a>\r\n    <button class=\"twitter\" aria-label=\"Share this page with Twitter\">Share on Twitter</button>\r\n</div>\r\n```\r\n\r\nCall the `jqss` plugin via javascript:\r\n\r\n```javascript\r\n$(function () {\r\n    $(\".social-container a, .social-container button\").jqss();\r\n});\r\n```\r\n\r\n## Templates\r\n\r\nThe plugin is packaged with templates for the following social networks: `amazon`, `blogger`, `buffer`, `delicious`, `digg`, `evernote`, `pinterest`, `pocket`, `quora`, `reddit`, `tumbleupon`, `tumblr`, `email`, `linkedin`, `facebook`, `twitter` and `googleplus`\r\n\r\nYou can add additional `templates` before initializing the plugin:\r\n\r\n```javascript\r\n$(function () {\r\n    $.fn.jqss.templates['custom'] = 'https://custom.com?u={{URL}}&t={{TITLE}}';\r\n\r\n    $(\".social-container a, .social-container button\").jqss();\r\n});\r\n```\r\n\r\nIt supports options with the all uppercase option name in the `{{OPTIONNAME}}` markup, the example above is using `{{URL}}` and `{{TITLE}}`.\r\n\r\n## Options\r\n\r\nMost options can be provided via `data-attributes` on each element. An option can be converted to a `data-attribute` by taking its name, replacing each uppercase letter with its lowercase equivalent preceded by a dash, and prepending `data-jqss-` to the result. For example, `usePopup` would be `data-jqss-use-popup`, `template` would be `data-jqss-template`, and `ariaLabelPrefix` would be `data-jqss-aria-label-prefix`.\r\n\r\nOptions set via `data-attributes` override any options set via `javascript` when initializing the plugin. Most options are global and would probably be set via `javascript`. The most common option to set with `data-attribute` on each element would be `template` in case you don't already specify it via a `class` that matches a template name.\r\n\r\n### usePopup\r\nBoolean. Default: `true`\r\n\r\nWhether or not a popup is used or a new window is opened instead.\r\n\r\n### popupWidth\r\nNumber. Default: `600`\r\n\r\nThe popup's width.\r\n\r\n### popupHeight\r\nNumber. Default: `450`\r\n\r\nThe popup's height.\r\n\r\n### ariaLabelPrefix\r\nString. Default: `Share with`\r\n\r\nThe prefix applied to the element when usign the `aria-label` defined for the template.\r\n\r\n### url\r\nString. Default: `location.href`\r\n\r\nThe url being shared that can be used as `{{URL}}` in a `template`.\r\n\r\n### siteUrl\r\nString. Default: `location.origin`\r\n\r\nThe site url that can be used as `{{SITEURL}}` in a `template`.\r\n\r\n### source\r\nString. Default: First value from meta tag(s) `[name=site], [name=Site]` from the document's `head`, if none is found the `document.title`.\r\n\r\nThe source that can be used as `{{SOURCE}}` in a `template`.\r\n\r\n### title\r\nString. Default: First value from meta tag(s) `[name=title], [name=Title]` from the document's `head`, if none is found the `document.title`.\r\n\r\nThe title that can be used as `{{TITLE}}` in a `template`.\r\n\r\n### description\r\nString. Default: First value from meta tag(s) `[name=description], [name=Description], meta[property='og:description'], meta[property='og:Description']` from the document's `head`, if none is found the `document.title`.\r\n\r\nThe description that can be used as `{{DESCRIPTION}}` in a `template`.\r\n\r\n### image\r\nString. Default: First value from meta tag(s) `meta[name=image], meta[name=Image], meta[property='og:image'], meta[property='og:Image']` from the document's `head`, if none is found the document's `img:first`.\r\n\r\nThe image url that can be used as `{{IMAGE}}` in a `template`.\r\n\r\n### price\r\nString. Default: First value from meta tag(s) `meta[property='og:product:price:amount']` from the document's `head`.\r\n\r\nThe price that can be used as `{{PRICE}}` in a `template`.\r\n\r\n### template\r\nString. Default: `null`.\r\n\r\nThe template name to be used. This option is ignored if set via the plugin's initialization, however you can define it as `data-attribute` on each element if not making use of the `class` to determine the template to use. The `email` template type will not use a popup and the `onOpen` and `onClose` callbacks won't be called.\r\n\r\n### imageSelector\r\nString. Default: `null`.\r\n\r\nA custom jQuery selector to be used instead of the default `image` option. Supports more than one image concatenating them with `||`.\r\n\r\n### priceSelector\r\nString. Default: `null`.\r\n\r\nA custom jQuery selector to be used instead of the default `price` option. Only supports one element's `text` value.\r\n\r\n### emailSubject\r\nString. Default: `I\\'m sharing \"{{TITLE}}\" with you`.\r\n\r\nThe subject to be used with the `email` mailto template. It supports all the options with the `{{****}}` markup.\r\n\r\n### emailBody\r\nString. Default: `Because I think you\\'ll find it very interesting.%0A%0A\"{{DESCRIPTION}}\"%0A%0AClick this link {{URL}} for more info.`.\r\n\r\nThe body to be used with the `email` mailto template. It supports all the options with the `{{****}}` markup.\r\n\r\n### twitterSource\r\nString. Default: First value from meta tag(s) `[name='twitter:creator'], [name='twitter:site']` from the document's `head`.\r\n\r\nThe source to be used with the `twitter` template.\r\n\r\n### onOpen\r\nFunction. Default: `empty`\r\n\r\nCallback method that is triggered when the popup or window opens, except for the `email` template. Sends the plugin's instance and element.\r\n\r\n```javacript\r\nfunction( instance, element )\r\n```\r\n\r\n### onClose\r\nFunction. Default: `empty`\r\n\r\nCallback method that is triggered when the popup or window closes, except for the `email` template. Sends the plugin's instance and element.\r\n\r\n```javacript\r\nfunction( instance, element )\r\n```\r\n\r\n## Methods\r\n\r\nMethods are accessed via the plugin's name `jqss` e.g. ```$('.social-container a.facebook').jqss('open')```\r\n\r\n### open(callsback)\r\nBoolean `callsback`. Default: `false`\r\n\r\nMethod to `open` the element share template. The argument `callsback` determines whether the `onOpen` and `onClose` callback's should be called.\r\n\r\n```javacript\r\n$('.social-container a.facebook').jqss('open');\r\n```\r\n\r\n### close(callsback)\r\nBoolean `callsback`. Default: `false`\r\n\r\nMethod to `close` the element share template if it is already open. The argument `callsback` determines whether the `onClose` callback should be called.\r\n\r\n```javacript\r\n$('.social-container a.facebook').jqss('close');\r\n```\r\n","maintainers":[{"name":"pnmcosta","email":"geral@pmcdigital.pt"}],"time":{"modified":"2022-06-19T05:12:43.116Z","created":"2017-03-31T14:45:41.613Z","1.0.3":"2017-03-31T14:45:41.613Z"},"homepage":"http://pnmcosta.github.io/jquery-socialshare","keywords":["jquery","social","share","sharing","flexible","plugin"],"repository":{"type":"git","url":"git://github.com/pnmcosta/jquery-socialshare.git"},"author":{"name":"Pedro Maia Costa","email":"geral@pmcdigital.pt"},"bugs":{"url":"https://github.com/pnmcosta/jquery-socialshare/issues/"},"license":"MIT","readmeFilename":"README.md"}