mrchimp / sharelinks Goto Github PK
View Code? Open in Web Editor NEWMake links to share the current page on social media sites.
Make links to share the current page on social media sites.
The platform name in the code is all lowercase, which is fine for its internal use.
I need to get the platform name in correct formation, e.g. LinkedIn, Facebook, Google+ etc.
I'm mapping the platform name string to an array outside of sharelinks.
var SocialNetworks = {
facebook : 'Facebook',
twitter : 'Twitter',
tumblr : 'Tumblr',
google : 'Google+',
pinterest : 'Pinterest',
linkedin : 'LinkedIn'
};
//Initialize sharelinks
sharelinks('.share-links a', {
onShare: function(data) {
console.log(SocialNetworks[data.platform]);
}
});
Can we include the real names inside of this plugin? Bonus we could use them in the title attribute instead of lowercase version.
Want a PR?
throw "Sharelinks Error: Invalid data-platform: " + $(this).data('platform');
Can this get updated and published to NPM?
This would be nice as a Vue component.
Would be nice to have GA event tracking build in.
https://support.google.com/analytics/answer/6209874
Option to pass in the UA code, and to enable / disable.
I'm probably doing this for a project, so I'll let you know what I do with this plugin.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.