New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement like / dislike count #17
Conversation
Comments that contain only `+1` or the +1 emoji, will be treated as a like. For dislike `-1` and -1 emoji. The count of the likes / dislikes will be shown in the sidebar of an issue or PR.
I'd personally want see these new sections in the sidebar named upvotes / downvotes instead of likes / dislikes. Or even better we could use the actual emoji instead of words. 125 馃憤 1 馃憥 |
Good point, I will fix this. |
Do we have to consider about the compatibility of ES6 syntax across different browser version, even in mobile ? |
馃憤
No, this is a Chrome extension, so we can use anything the latest Chrome version supports. |
@SpaceK33z Can you fix the merge conflict? |
voteHeading.className = 'discussion-sidebar-heading'; | ||
voteHeading.textContent = count + ' ' + type; | ||
voteElement.appendChild(voteHeading); | ||
sidebar.appendChild(voteElement); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very verbose. Can you just use a HTML string?
Sometimes +1 and comments are given to a specific response rather than the topic itself. Is it okay to count those +1/upvote/downvote as a whole ? |
@tngan Would be hard differentiate that, though. I think this is good for now and we can improve it over time. |
# Conflicts: # extension/content.js
- Use `includes` instead of `indexOf` - Use jQuery instead of native DOM api - `remove` instead of `removeChild`
Yeah I see this as a simple first version which should certainly be improved. Later we could improve it with:
@sindresorhus, I've implemented your feedback. |
If you type a comment with `:+1: `, this went undetected. Not entirely happy with how I fixed it, but it does make it easier to add detection for words after a thumbs up in the future. Tested on a few pages: - isaacs/github#253 - isaacs/github#9
Okay, I'm done now :). |
Super nice work on this @SpaceK33z :D Would you mind opening an issue with your above ideas on further improvements? |
Adding you to the repo since per the open open source idea. |
@sindresorhus thanks for that! Will open an issue later. |
Comments that contain only
+1
or 馃憤 will be treated as a like. For dislike-1
and 馃憥.The count of the likes / dislikes will be shown in the sidebar of an issue or PR, like this:
Fixes #15. In #15 I showed a screenshot that also shows user avatars; I've decided not to this for now (maybe later).
Personally I've no use for this feature, but I've much sympathy for huge open-source project maintainers and hope to help them :).