-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Fix raw image paste from clipboard #8702
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
|
I've prepared a stage to preview changes. Open stage or view logs. |
|
Worth noting raw pasting on GitHub also only works on Chrome. |
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.
Can you please remove this comment? The function name is already prety selfexplenatory :)
|
@m-a-r-c-o Thanks :) Code looks good, but it would be great if you can remove the ambigious comments, since they always have the tendency to start lying at some point in time :) |
|
@jvanbaarsen ok, you're right :-) I just removed the comments and I'll push it in a second commit. If you would like to have everything in one commit, please let me know. |
|
@m-a-r-c-o It would be really helpfull if you can squash the 2 commits :) |
|
Also, thanks for the quick reply ❤️ |
|
Also don't forget a changelog entry. |
This patch binds the textarea (markdown area) paste event to the handlePaste() function (that was already present). Furthermore the event processing is improved in the following way: - The default paste event handler of the browser is only disabled if the browser fully supports clipboardData AND there realy is image data in the event object. In all other cases (no support or no image) the default handler processes the text paste. - Some obsolete code was removed. - The pasteText() function (which is somehow buggy because it places the cursor at the end of the text independantly from its position before the paste) is only used to place the image link after image data was pasted.
|
@jvanbaarsen Now it's one commit. Shall I add a changelog entry? Or is this done by someone of the core team? |
|
You can do so :-) On Sun, Feb 1, 2015 at 10:46 PM, Marco Cyriacks notifications@github.com
|
|
@jvanbaarsen Ok, I did it :-) |
|
@m-a-r-c-o Thanks! |
Fix raw image paste from clipboard
|
Thank you! |
|
Excited to see this added! |
|
@m-a-r-c-o would be awesome if you could submit another PR updating the text below the box to state something like follows if their browser supports paste uploading:
|
|
@bbodenmiller Good idea, I'll place it on my ToDo. Currently I've not enough time to dive into this. |
This is a patch that activates the functionality to paste raw images from the clipboard to markdown areas in GitLab. Unfortunately this currently only works in the chrome browser but I think it is a first step.
This is a possible solution for #7392
Please review and consider for inclusion.
@jvanbaarsen This is the new pull request replacing pull request #7891
Best regards
Marco