-
Notifications
You must be signed in to change notification settings - Fork 203
Fixes #722 - Handle two sizes images #1266
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
Conversation
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.
Looks good!
Would it be possible to add a test or two to test_uploads.py? I'm not actually sure what that would look like, since the tests are a bit of a hack, just testing responses. (I won't block on tests, but it would be nice!)
❤️
this.addImageURL = function(url) { | ||
var file_ext = url.split('.').pop(); | ||
var thumb_url = url.replace('.' + file_ext, '-thumb.' + file_ext); | ||
var imageURL = ['[](', url, ')'].join(''); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
var imageURL = [''].join(''); | ||
this.addImageURL = function(url) { | ||
var file_ext = url.split('.').pop(); | ||
var thumb_url = url.replace('.' + file_ext, '-thumb.' + file_ext); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
var compiledImageURL = imageURL({url: response.url}); | ||
var img_url = response.url; | ||
var file_ext = img_url.split('.').pop(); | ||
var thumb_url = img_url.replace('.' + file_ext, '-thumb.' + file_ext); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Thanks @miketaylr for the cool review. :) |
Looks good! r+ (Can you file an issue for adding some thumbnail tests?) |
ahah. forgotten about that. Done with #1267 ❤️ |
Let's revert this for now, sorry @karlcow! Another thing to fix when you figure out why the bug form uploads are broken: if you click "Remove image upload", it should remove the link in description. |
This modifies the python upload code and the JavaScript libraries handling the markup.
Note that for the JS, the previous code is using two different methods for inserting the code at the right place even if they do exactly the same thing. This should be abstracted.
r? @miketaylr