sampotts / shr Goto Github PK
View Code? Open in Web Editor NEWSimple, clean, and customizable social sharing buttons.
License: MIT License
Simple, clean, and customizable social sharing buttons.
License: MIT License
I thought changing the config to share_count would do the trick but it does not. I can see that local storage is storing this: (a snippit)
"facebook":{"share":{"comment_count":0,"share_count":3},
but your app never gets that share count of 3, instead it sees the count as zero.
Can you fix this?
Facebook counter doesn't display anymore.
this block of code here should be removed from the local storage test:
if ('localStorage' in window && window.localStorage !== null) {
return false;
}
that is going to return false if something else already is using local storage, even thought it still is available for use. Remove that block and all will be fine.
YouTube subscribe is not supported.
Adding a YouTube subscribe button would be awesome and allow users to see how many
people are subscribed to the channel, but also subscribe easily themselves. This would
work great for embedded videos.
I'll implement the YouTube subscribe button using the YouTube API. This will be dependent
upon expanding the config to allow for API keys and usernames.
If you'd like to move forward, let me know and I'll submit a PR!
Demo doesnt work, neither does the package itself, needs polyfill for Object.assign etc but still fails to work.
prefixData
function is called here but no longer exists.
Hi,
Thanks for this lib and the others, your work is very appreciated!
I was wonder, did you plan to publish shr on npm?
Bests ๐
When expanding to multiple networks, having values and prefixes in the default
config gets harder to read.
Currently in the default config, there is an object named count, that has two keys (value, prefix).
These objects contain the keys in the JSON returned from the APIs to get the counts we are looking
for. As we expand social networks, some counts are not in the first or second hierarchy of the JSON
returned so we end up prefixing some of the prefixes. To structure it modularly and into separate methods,
will make it easier to scope the issue and expand. Also, if we are grabbing different counts from the
same source, this will allow us to access this data independently.
I will go through the code, take each social network, and make a method that calculates what is returned
for the screen data.
...
var defaults = {
count: {
...
value: {
facebook: 'share_count',
github: 'stargazers_count'
},
prefix: {
github: 'data'
},
},
...
Will get removed and merged into separate methods scoped for the network.
If you have any questions, let me know. If you'd like to move forward, let me know
and I'll submit a PR!
We have a flag for incrementing the count on click. This doesn't update the storage so if I refresh the page my click isn't stored.
It can be kind of misleading when I see an increment, refresh the page and it isn't there.
Update the storage if increment is set.
Refreshing the page will show the new share.
If I click and didn't share, then the number will be wrong and won't correct itself until the cache expires.
Let me know your thoughts on this and we can find a way to resolve this issue!
Shr has lots of cool buttons, I'll update the docs on how to use them all!
Shr is beautiful and should be used more. Re-writing the docs and giving an example
for each element and how to initialize it will help adoption of Shr. Every new network
we add will have an example and allow other devs to implement with ease.
I'll write a whole bunch of documentation for implementing Shr
If you'd like to move forward, let me know and I'll submit a PR!
Shr only supports LESS, I'll write SASS to be used along with LESS.
Really just another option for compilation. I happen to know SASS and can structure
it the same way that you have your LESS structured so other devs can contribute as
well or use in the situation they have their application written in.
I'll write the SASS code for Shr.
If you'd like to move forward, let me know and I'll submit a PR!
When using Shr in a framework such as Foundation or Bootstrap, the .button
CSS class
used to render Shr is bombarded with unwanted class styles that overwrite the Shr
styles.
Frameworks such as Bootstrap and Foundation are very common and utilize the .button
class to style HTML elements. Shr uses this too. The problem is that the two classes
conflict with each other allowing the Shr buttons not to render correctly.
I'll re-scope the .button
class to be .shr-button
.
.shr-button
If you'd like to move forward, let me know and I'll submit a PR!
Code needs JSDoc comments for easy reading and documentation
Utilizing JSDoc makes it easier to bring other developers on board and keeps
a standard for documenting code. This will help other contributors pick up the code and dive
right in. It also provides a baseline for how other contributors comment their features. The
standard is here: http://usejsdoc.org/
I will go through the existing Shr code, and comment all of the features and methods
using JSDoc.
Let me know if JSDoc is something you are interested in and I'll get it added and submit a PR
WhatsApp and Telegram (for groups and channels)
Hi Sam,
Your share buttons are the most beautiful social sharing buttons I have seen on the web. Job well done!
I apologize for my lack of knowledge when it comes to HTML/CSS, but I am having trouble getting started. I followed your instructions to the best of my knowledge, but I still cannot seem to get it to work. I get things to appear without any console errors, but from this point I'm not sure where to go:
I guess the good thing is that once I can figure it out, I am pretty sure anyone else can figure it out :-) Once I figure it out, I would love to submit a pull request with clear documentation on how to get started for newbies.
I know this is open source work too, so no rush! Whenever you have a free moment. Thanks again!
As we integrate more social networks, such as subscribe on Youtube, we might need
to account for public facing API keys or username data.
As we expand more buttons, and use Shr for more features, just allowing the user
to pass in the proper API keys/username data will be extremely helpful.
I'll expand the config to allow for more buttons to be added by handling API keys,
user names, or other config options.
If you'd like to move forward, let me know and I'll submit a PR!
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.