Project

General

Profile

Actions

Patch #32596

closed

fix image pasting for Edge

Added by Jens Krämer about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Attachments
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

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

Related to Redmine - Patch #32552: Clarify that pasting images from clipboard does not support Internet ExplorerClosedGo MAEDA

Actions
Related to Redmine - Feature #3816: Allow pasting screenshots from clipboardClosedGo MAEDA2009-09-03

Actions
Actions #1

Updated by Yuichi HARADA about 5 years ago

Jens Priesen 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);
   }
Actions #2

Updated by Jens Krämer about 5 years ago

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

Actions #3

Updated by Marius BĂLTEANU about 5 years ago

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

Updated by Marius BĂLTEANU about 5 years ago

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

Updated by Marius BĂLTEANU about 5 years ago

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

Actions #6

Updated by Marius BĂLTEANU about 5 years ago

  • Assignee set to Go MAEDA
Actions #7

Updated by Go MAEDA about 5 years ago

  • 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: Atom PDF