@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

When pasting both image data and text into Chrome, use only the text

Summary: Fixes T5437. This actual behavior is debateable but this is the one that seems simplest and most sensible.

Test Plan: Copied some cells from Numbers, pasted them into a remarkup box in Chrome, got just the text.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T5437

Differential Revision: https://secure.phabricator.com/D9647

+29 -16
+12 -12
resources/celerity/map.php
··· 11 11 'core.pkg.js' => '07b01d4f', 12 12 'darkconsole.pkg.js' => 'ca8671ce', 13 13 'differential.pkg.css' => '4a93db37', 14 - 'differential.pkg.js' => '2b128f3a', 14 + 'differential.pkg.js' => '5b252007', 15 15 'diffusion.pkg.css' => '471bc9eb', 16 16 'diffusion.pkg.js' => '077e3ad0', 17 17 'maniphest.pkg.css' => 'f88a8402', ··· 434 434 'rsrc/js/application/uiexample/gesture-example.js' => 'f42bb8c6', 435 435 'rsrc/js/application/uiexample/notification-example.js' => 'c51a6616', 436 436 'rsrc/js/core/Busy.js' => '6453c869', 437 - 'rsrc/js/core/DragAndDropFileUpload.js' => 'ae6abfba', 437 + 'rsrc/js/core/DragAndDropFileUpload.js' => '1d8ad5c3', 438 438 'rsrc/js/core/DraggableList.js' => '109e2a87', 439 439 'rsrc/js/core/FileUpload.js' => 'a4ae61bf', 440 440 'rsrc/js/core/Hovercard.js' => '4f344388', ··· 708 708 'phabricator-countdown-css' => '86b7b0a0', 709 709 'phabricator-crumbs-view-css' => '7fbf25b8', 710 710 'phabricator-dashboard-css' => '22dfc441', 711 - 'phabricator-drag-and-drop-file-upload' => 'ae6abfba', 711 + 'phabricator-drag-and-drop-file-upload' => '1d8ad5c3', 712 712 'phabricator-draggable-list' => '109e2a87', 713 713 'phabricator-fatal-config-template-css' => '25d446d6', 714 714 'phabricator-feed-css' => '5cbec787', ··· 970 970 1 => 'javelin-util', 971 971 2 => 'phabricator-keyboard-shortcut-manager', 972 972 ), 973 + '1d8ad5c3' => 974 + array( 975 + 0 => 'javelin-install', 976 + 1 => 'javelin-util', 977 + 2 => 'javelin-request', 978 + 3 => 'javelin-dom', 979 + 4 => 'javelin-uri', 980 + 5 => 'phabricator-file-upload', 981 + ), 973 982 '1da67f34' => 974 983 array( 975 984 0 => 'javelin-behavior', ··· 1655 1664 2 => 'javelin-stratcom', 1656 1665 3 => 'javelin-dom', 1657 1666 4 => 'javelin-vector', 1658 - ), 1659 - 'ae6abfba' => 1660 - array( 1661 - 0 => 'javelin-install', 1662 - 1 => 'javelin-util', 1663 - 2 => 'javelin-request', 1664 - 3 => 'javelin-dom', 1665 - 4 => 'javelin-uri', 1666 - 5 => 'phabricator-file-upload', 1667 1667 ), 1668 1668 'b3a4b884' => 1669 1669 array(
+17 -4
webroot/rsrc/js/core/DragAndDropFileUpload.js
··· 121 121 'paste', 122 122 null, 123 123 JX.bind(this, function(e) { 124 - var clipboardData = e.getRawEvent().clipboardData; 125 - if (!clipboardData) { 124 + var clipboard = e.getRawEvent().clipboardData; 125 + if (!clipboard) { 126 + return; 127 + } 128 + 129 + // If there's any text on the clipboard, just let the event fire 130 + // normally, choosing the text over any images. See T5437 / D9647. 131 + var text = clipboard.getData('text/plain').toString(); 132 + if (text.length) { 133 + return; 134 + } 135 + 136 + // Safari and Firefox have clipboardData, but no items. They 137 + // don't seem to provide a way to get image data directly yet. 138 + if (!clipboard.items) { 126 139 return; 127 140 } 128 141 129 - for (var ii = 0; ii < clipboardData.items.length; ii++) { 130 - var item = clipboardData.items[ii]; 142 + for (var ii = 0; ii < clipboard.items.length; ii++) { 143 + var item = clipboard.items[ii]; 131 144 if (!/^image\//.test(item.type)) { 132 145 continue; 133 146 }