Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/core/DragAndDropFileUpload.js
Show First 20 Lines • Show All 126 Lines • ▼ Show 20 Lines | start : function() { | ||||
} | } | ||||
for (var ii = 0; ii < clipboardData.items.length; ii++) { | for (var ii = 0; ii < clipboardData.items.length; ii++) { | ||||
var item = clipboardData.items[ii]; | var item = clipboardData.items[ii]; | ||||
if (!/^image\//.test(item.type)) { | if (!/^image\//.test(item.type)) { | ||||
continue; | continue; | ||||
} | } | ||||
this._sendRequest(item.getAsFile()); | this._sendRequest(item.getAsFile()); | ||||
// If the paste has both image and text data, prefer the image. | |||||
// This happens when pasting from Numbers on OS X. | |||||
e.prevent(); | |||||
} | } | ||||
})); | })); | ||||
} | } | ||||
}, | }, | ||||
_sendRequest : function(spec) { | _sendRequest : function(spec) { | ||||
var file = new JX.PhabricatorFileUpload() | var file = new JX.PhabricatorFileUpload() | ||||
.setName(spec.name) | .setName(spec.name) | ||||
.setTotalBytes(spec.size) | .setTotalBytes(spec.size) | ||||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |