Project

General

Profile

Actions

Patch #32596

closed

fix image pasting for Edge

Patch #32596: fix image pasting for Edge

Added by Jens Krämer almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Attachments
Target version:
-

Description

The attached patch courtesy of Planio fixes image pasting for Edge (without breaking it for other browsers) by constructing a Blob instead of a File in the paste handler.

I also amended the detailed help files where a note that IE and Edge are not supported has recently been added (#32552). Lacking the language skills I did not change the japanese files, that would still have to be done.


Files


Related issues 2 (0 open — 2 closed)

Related to Redmine - Patch #32552: Clarify that pasting images from clipboard does not support Internet ExplorerClosedGo MAEDAActions
Related to Redmine - Feature #3816: Allow pasting screenshots from clipboardClosedGo MAEDAActions

Updated by Yuichi HARADA almost 7 years ago Actions #1

@Jens Krämer, thank you for providing a great patch. However, nothing is displayed on the preview screen immediately after the image is pasted (all of the browsers except IE).
If you add the following patch together, it will work.

diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js
index 645038284..053ef076a 100644
--- a/public/javascripts/attachments.js
+++ b/public/javascripts/attachments.js
@@ -103,7 +103,7 @@ function uploadBlob(blob, uploadUrl, attachmentId, options) {
   }, options);

   uploadUrl = uploadUrl + '?attachment_id=' + attachmentId;
-  if (blob instanceof window.File) {
+  if (blob instanceof window.Blob) {
     uploadUrl += '&filename=' + encodeURIComponent(blob.name);
     uploadUrl += '&content_type=' + encodeURIComponent(blob.type);
   }

Updated by Jens Krämer almost 7 years ago Actions #2

Thanks for pointing this out! Attached is a new patch including the above fix.

Updated by Marius BĂLTEANU almost 7 years ago Actions #3

  • Related to Patch #32552: Clarify that pasting images from clipboard does not support Internet Explorer added

Updated by Marius BĂLTEANU almost 7 years ago Actions #4

  • Related to Feature #3816: Allow pasting screenshots from clipboard added

Updated by Marius BĂLTEANU almost 7 years ago Actions #5

  • Target version set to Candidate for next major release

Thanks Jens and Yuichi for fixing this issue on Edge. I propose to commit this as part of the related issues.

Updated by Marius BĂLTEANU almost 7 years ago Actions #6

  • Assignee set to Go MAEDA

Updated by Go MAEDA almost 7 years ago Actions #7

  • Category set to Attachments
  • Status changed from New to Closed
  • Target version deleted (Candidate for next major release)

Committed the fix. Thank you for improving the feature.

Actions

Also available in: PDF Atom