npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

social-share-js

v1.0.4

Published

A jquery plugin to provide more control on social sharing buttons.

Downloads

41

Readme

socialShare.js

A jquery plugin to provide more control on social sharing buttons. Do the styling without worrying about the javascript implementation.

Demo is available at http://rkritesh.in/socialShare.js

screen

Features

  • Full control over the design of the buttons.
  • No separate widget js loading for separate services.
  • Share counts of all supported services.
  • Easy to configure.

Getting Started

Download the production version or the development version.

Install from npm

npm install --save social-share-js

Install from bower

bower install --save social-share-js

Manual injection in your web page:

<script src="jquery.js"></script>
<script src="dist/jquery.socialshare.min.js"></script>

##Simple Usage

This is the minimal configuration required to use the plugin

$(element).socialShare({
	image 			: 'image-url',
	twitterVia		: 'ritz078',
	twitterHashTags : 'javascript,jquery'
});

##Advanced Options property|default value|Description --------|-------------|----------- url|current page url|The url that will be shared description|current page meta tag description|Can be set to be shared as description on twitter title|current page title|Title that will be shared counts|true|set to false to bypass http request to get the counts twitter|true|set to false to disable pinterest|true|set to false to disable facebook|true|set to false to disable linkedin|true|set to false to disable gPlus|true|set to false to disable image|null|url of the image that will be shared with the links toWord|true|to convert count numbers into words eg: 12000 to 12K twitterVia|null|string containing the via value for twitter sharing eg: 'ritz078'.Mandatory if twitter is set to true twitterHashTags|null|comma separated values to be shared as hashtags in a single string.Mandatory if twitter is set to true.

##How to use ? You can use these 2 classes to make a class clickable(open share dialogue) and show the share counts.

  • [service]-share and
  • [service]-count

where [service] = twitter/facebook/pinterest/linkedin/gPlus

Just add them wherever you want to use them

Class|Description|example ------|----------|------- [service]-share|This is the class that becomes a link after clicking on which the sharing dialogue appears| <div class="twitter-share"></div> [service]-count|Class in which the share count appears|<span class="twitter-count"></span>

##Example Usage

  • HTML can comprise of any structure and tags
  • Just use the 2 types of class provided
<div class="element">
<!--===== this block will become clickable (shows the twitter share dialogue on click) 
because of the class 'twitter-share'====-->
	<div class="twitter-share">
		<span>Share on twitter</span>
		<span class="twitter-count"></span> <!--====shows twitter share count==-->
	</div>
	<!--=======================================-->

	<!--===== this block will become clickable (shows the facebook share dialogue on click) 
because of the class 'facebook-share'====-->
	<div class="facebook-share">
		<span>Share on Facebook</span>
		<span class="facebook-count"></span><!--=== shows facebook share count==-->
	</div>
	<!--======================================-->
</div>

<script>
	$('.element').socialShare({
		image 			: 'image-url',
		twitterVia		: 'ritz078',
		twitterHashTags : 'javascript,jquery'
	})
</script>

Demo is available at http://rkritesh.in/socialShare.js

License

MIT © Ritesh Kumar