Skip to content

Conversation

@m-a-r-c-o
Copy link
Contributor

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

@TeatroIO
Copy link

I've prepared a stage to preview changes. Open stage or view logs.

@bbodenmiller
Copy link
Contributor

Worth noting raw pasting on GitHub also only works on Chrome.

Copy link
Contributor

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 :)

@jvanbaarsen
Copy link
Contributor

@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 :)

@m-a-r-c-o
Copy link
Contributor Author

@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.

@jvanbaarsen
Copy link
Contributor

@m-a-r-c-o It would be really helpfull if you can squash the 2 commits :)

@jvanbaarsen
Copy link
Contributor

Also, thanks for the quick reply ❤️

@bbodenmiller
Copy link
Contributor

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.
@m-a-r-c-o
Copy link
Contributor Author

@jvanbaarsen Now it's one commit.

Shall I add a changelog entry? Or is this done by someone of the core team?

@jvanbaarsen
Copy link
Contributor

You can do so :-)

On Sun, Feb 1, 2015 at 10:46 PM, Marco Cyriacks notifications@github.com
wrote:

@jvanbaarsen Now it's one commit.

Shall I add a changelog entry? Or is this done by someone of the core team?

Reply to this email directly or view it on GitHub:
#8702 (comment)

@m-a-r-c-o
Copy link
Contributor Author

@jvanbaarsen Ok, I did it :-)

@jvanbaarsen
Copy link
Contributor

@m-a-r-c-o Thanks!

dzaporozhets added a commit that referenced this pull request Feb 4, 2015
@dzaporozhets dzaporozhets merged commit cb2093f into gitlabhq:master Feb 4, 2015
@dzaporozhets
Copy link
Contributor

Thank you!

@bbodenmiller
Copy link
Contributor

Excited to see this added!

@m-a-r-c-o m-a-r-c-o deleted the raw-image-paste-fix branch February 4, 2015 19:58
@bbodenmiller
Copy link
Contributor

@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:

Attach files by dragging & dropping, selecting them, or pasting from the clipboard.

@m-a-r-c-o
Copy link
Contributor Author

@bbodenmiller Good idea, I'll place it on my ToDo. Currently I've not enough time to dive into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

5 participants