Skip to content

Conversation

@jgierer12
Copy link
Contributor

@jgierer12 jgierer12 commented Apr 17, 2017

This adds labels similar to GitHub's existing labels (Owner/Contributor/Collaborator) to comments by the user who submitted the issue/PR.

Timeline comments: Screenshot

With multiple labels: Screenshot with multiple labels

Review comments: Screenshot of review comment

Fixes #365

This adds labels similar to GitHub's existing ones
(Owner/Contributor/Collaborator) to comments posted by the user who opened the
issue or PR.
</span>
`;

const comments = $('.js-comment').toArray();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const comments = $('div.js-comment').toArray();

Without the specificity for a div this feature doesn't work when someone has the ability to edit another users comments. (The first item in the array is a form.)

@paulmolluzzo
Copy link
Contributor

Also, see #375 (comment)

Thanks for another PR! 🙌

@paulmolluzzo
Copy link
Contributor

Any comments on this PR or are we OK to 🚢 ?

@sindresorhus
Copy link
Member

I don't think we should add "Original Poster" to the initial issue/PR as it's already obvious, but rather only on additional comments by OP.

Merge conflicts needs resolving.

@jgierer12 Can you add it to the readme, like I did here: b695fc4

jgierer12 added a commit to jgierer12/refined-github that referenced this pull request Apr 20, 2017
@jgierer12 jgierer12 force-pushed the enhancement/op-labels branch from 59fbce1 to 8990ae3 Compare April 20, 2017 19:18
@paulmolluzzo
Copy link
Contributor

Merge conflicts needs resolving.

@jgierer12 Can you please resolve this? I think we're good otherwise. Thanks!

@sindresorhus
Copy link
Member

I've also noticed now that if you switch between the "Conversation" tab and "Files" tab in a pull request, it will re-add the OP badge each time you go to "Conversation".

@jgierer12
Copy link
Contributor Author

jgierer12 commented Apr 21, 2017

Could we change document.addEventListener('DOMContentLoaded', () => {...} in this line to jQuery's $(document).ready(() => {...})/$(() => {...}) instead? Or would that break something?

Edit: Probably not an option since it won't work for AJAX'ed comments. I think I'll just add a data attribute to comments that already have the label.

@sindresorhus
Copy link
Member

Just add a custom class to the HTML you inject and check for that before injecting. We do that with many of the other features. Could be .refined-github-op.

@paulmolluzzo
Copy link
Contributor

@sindresorhus anything else?

@sindresorhus sindresorhus merged commit 5a86c08 into refined-github:master Apr 25, 2017
@sindresorhus
Copy link
Member

Really good work @jgierer12 :)

@jgierer12 jgierer12 mentioned this pull request May 5, 2017
2 tasks
@jgierer12 jgierer12 deleted the enhancement/op-labels branch May 12, 2017 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants