Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13980837
D11513.id27691.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11513.id27691.diff
View Options
diff --git a/webroot/rsrc/js/core/DragAndDropFileUpload.js b/webroot/rsrc/js/core/DragAndDropFileUpload.js
--- a/webroot/rsrc/js/core/DragAndDropFileUpload.js
+++ b/webroot/rsrc/js/core/DragAndDropFileUpload.js
@@ -168,6 +168,34 @@
}
}));
}
+
+ var inputField, wipeInputField, handleFileSelect;
+
+ handleFileSelect = JX.bind(this, function (evt) {
+ var files = evt.target.files;
+ for (var i = 0; i < files.length; i++) {
+ this._sendRequest(files[i]);
+ }
+
+ wipeInputField();
+ });
+
+ wipeInputField = JX.bind(this, function () {
+ if(inputField) {
+ inputField.parentNode.removeChild(inputField);
+ }
+
+ inputField = document.createElement('input');
+ inputField.setAttribute('type', 'file');
+ inputField.setAttribute('multiple', 'multiple');
+ inputField.setAttribute('id', 'file-upload-input');
+
+ this._node.parentNode.appendChild(inputField);
+ inputField.addEventListener('change', handleFileSelect, false);
+ });
+
+ wipeInputField();
+ JX.DOM.hide(inputField);
},
_sendRequest : function(spec) {
var file = new JX.PhabricatorFileUpload()
diff --git a/webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js b/webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js
--- a/webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js
+++ b/webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js
@@ -150,7 +150,7 @@
.start();
break;
case 'fa-cloud-upload':
- new JX.Workflow('/file/uploaddialog/').start();
+ JX.DOM.show(JX.$('file-upload-input'));
break;
case 'fa-arrows-alt':
if (edit_mode == 'fa-arrows-alt') {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 20, 12:48 PM (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6736471
Default Alt Text
D11513.id27691.diff (1 KB)
Attached To
Mode
D11513: (T5187) Allow uploading files directly when editing a comment without drag&drop/copy&paste
Attached
Detach File
Event Timeline
Log In to Comment