1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 06:20:56 +01:00

Remarkup - call pasted files "pasted_file" rather than "undefined"

Summary: Fixes T5917. Turns out that pasted files don't get a name - "what is data on a clipboard anyway?" / see https://code.google.com/p/chromium/issues/detail?id=361145

Test Plan: pasted a file and got the slightly better name "pasted_file"

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5917

Differential Revision: https://secure.phabricator.com/D10310
This commit is contained in:
Bob Trahan 2014-08-20 16:21:50 -07:00
parent 66fa59d04d
commit 0ddafc4bcd
2 changed files with 18 additions and 12 deletions

View file

@ -11,7 +11,7 @@ return array(
'core.pkg.js' => 'f67c8265', 'core.pkg.js' => 'f67c8265',
'darkconsole.pkg.js' => 'df001cab', 'darkconsole.pkg.js' => 'df001cab',
'differential.pkg.css' => '36884139', 'differential.pkg.css' => '36884139',
'differential.pkg.js' => 'eb182ccd', 'differential.pkg.js' => 'fe026527',
'diffusion.pkg.css' => '591664fa', 'diffusion.pkg.css' => '591664fa',
'diffusion.pkg.js' => 'bfc0737b', 'diffusion.pkg.js' => 'bfc0737b',
'maniphest.pkg.css' => 'f5d89daf', 'maniphest.pkg.css' => 'f5d89daf',
@ -437,7 +437,7 @@ return array(
'rsrc/js/application/uiexample/gesture-example.js' => '558829c2', 'rsrc/js/application/uiexample/gesture-example.js' => '558829c2',
'rsrc/js/application/uiexample/notification-example.js' => '7a9677fc', 'rsrc/js/application/uiexample/notification-example.js' => '7a9677fc',
'rsrc/js/core/Busy.js' => '6453c869', 'rsrc/js/core/Busy.js' => '6453c869',
'rsrc/js/core/DragAndDropFileUpload.js' => 'f61aa8ec', 'rsrc/js/core/DragAndDropFileUpload.js' => '8c49f386',
'rsrc/js/core/DraggableList.js' => 'bfccc644', 'rsrc/js/core/DraggableList.js' => 'bfccc644',
'rsrc/js/core/FileUpload.js' => 'a4ae61bf', 'rsrc/js/core/FileUpload.js' => 'a4ae61bf',
'rsrc/js/core/Hovercard.js' => '7e8468ae', 'rsrc/js/core/Hovercard.js' => '7e8468ae',
@ -712,7 +712,7 @@ return array(
'phabricator-countdown-css' => '86b7b0a0', 'phabricator-countdown-css' => '86b7b0a0',
'phabricator-crumbs-view-css' => '7fbf25b8', 'phabricator-crumbs-view-css' => '7fbf25b8',
'phabricator-dashboard-css' => 'a2bfdcbf', 'phabricator-dashboard-css' => 'a2bfdcbf',
'phabricator-drag-and-drop-file-upload' => 'f61aa8ec', 'phabricator-drag-and-drop-file-upload' => '8c49f386',
'phabricator-draggable-list' => 'bfccc644', 'phabricator-draggable-list' => 'bfccc644',
'phabricator-fatal-config-template-css' => '25d446d6', 'phabricator-fatal-config-template-css' => '25d446d6',
'phabricator-feed-css' => '4e544db4', 'phabricator-feed-css' => '4e544db4',
@ -1385,6 +1385,14 @@ return array(
'javelin-request', 'javelin-request',
'javelin-typeahead-source', 'javelin-typeahead-source',
), ),
'8c49f386' => array(
'javelin-install',
'javelin-util',
'javelin-request',
'javelin-dom',
'javelin-uri',
'phabricator-file-upload',
),
'8d199d97' => array( '8d199d97' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-dom', 'javelin-dom',
@ -1867,14 +1875,6 @@ return array(
'multirow-row-manager', 'multirow-row-manager',
'javelin-json', 'javelin-json',
), ),
'f61aa8ec' => array(
'javelin-install',
'javelin-util',
'javelin-request',
'javelin-dom',
'javelin-uri',
'phabricator-file-upload',
),
'f6555212' => array( 'f6555212' => array(
'javelin-install', 'javelin-install',
'javelin-reactornode', 'javelin-reactornode',

View file

@ -158,7 +158,13 @@ JX.install('PhabricatorDragAndDropFileUpload', {
if (!/^image\//.test(item.type)) { if (!/^image\//.test(item.type)) {
continue; continue;
} }
this._sendRequest(item.getAsFile()); var spec = item.getAsFile();
// pasted files don't have a name; see
// https://code.google.com/p/chromium/issues/detail?id=361145
if (!spec.name) {
spec.name = 'pasted_file';
}
this._sendRequest(spec);
} }
})); }));
} }