Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect data urls and display an alert #178

Merged
merged 4 commits into from
Dec 13, 2018

Conversation

okonek
Copy link
Contributor

@okonek okonek commented Dec 11, 2018

fixes #175
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts
  • PR is descriptively titled
  • PR body includes fixes #0000-style reference to original issue #
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

We have a loose schedule of reviewing and pulling in changes every Tuesday and Friday, and publishing changes on Fridays.

Thanks!
data-urls

@welcome
Copy link

welcome bot commented Dec 11, 2018

Thanks for opening this pull request! Dangerbot will test out your code and reply in a bit with some pointers and requests.
There may be some errors, but don't worry! We're here to help! 👍🎉😄

@okonek
Copy link
Contributor Author

okonek commented Dec 11, 2018

@jywarren Take a look and review when you have time, please. Let me know if there is anything to change in this piece of code.

@jywarren
Copy link
Member

Hi, i'm sorry, i merged a commit by @dependabot and caused a conflict. Do you think you could resolve it?

I'm also wondering if we could add a test for this behavior. We could paste a small dataurl into the codebase and then check for the alert to be shown. We could do something pretty simple -- see this for entering something into the rich text module textarea:

then we could do expect($('.alert.data-urls-warning').length).toBe(1);

What do you think?

@jywarren
Copy link
Member

But also I believe we need to run grunt build on this and to check in the newly compiled file from the dist folder.

@jywarren
Copy link
Member

Thanks @okonek ! This project is a bit neglected so your help here is MUCH appreciated! Several of the other sub-libraries of PL have a lead developer, but not this one! It's too bad because there are some really cool features which we could build out, like this one on autocompleting tagnames, usernames, and such with the atwho library, just as we do in comments on PublicLab.org: #44

@okonek
Copy link
Contributor Author

okonek commented Dec 12, 2018

@jywarren No, problem I can write the tests, but how am I supposed to resolve the conflict? Should I rebase or just remove this fork and start another one? What did you mean by that? Thanks.

@okonek
Copy link
Contributor Author

okonek commented Dec 12, 2018

@jywarren I'm very sorry, but I was sitting on this for like two or three hours and couldn't figure out the way to do the tests for this, because setting the textarea value with code doesn't trigger the keydown event. Could you approve it how it is, please? Maybe we could figure out how to do the tests later on.

@jywarren
Copy link
Member

Approved! I think there's a way to trigger the event manually... Maybe we do this elsewhere in the tests?

@okonek
Copy link
Contributor Author

okonek commented Dec 12, 2018

Yes, I tried $().trigger("keydown"), but it did not succeed, also I searched in the other tests for some similar code, but I did not find any.

@jywarren jywarren merged commit c2b8f23 into publiclab:master Dec 13, 2018
@welcome
Copy link

welcome bot commented Dec 13, 2018

Congrats on merging your first pull request! 🙌🎉⚡️
Your code will likely be published to https://publiclab.org in the next few days.
In the meantime, can you tell us your Twitter handle so we can thank you properly?
Now that you've completed this, you can help someone else take their first step!
See: Public Lab's coding community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Detect data-urls in content, and display a warning
2 participants