Improve paste uploading Resolve #3023 (#4542)

* resolve #3023

* fix

* fix

* better description

* widget

* fix text

* Update post-form.vue

* Fix enter-file-name dialog title text

* Fix type

* On messaging room

* Replace moment.js to original one

* Fix formatDateTimeString
This commit is contained in:
tamaina
2019-07-08 13:46:31 +09:00
committed by syuilo
parent eb783f827c
commit 5343b005df
10 changed files with 163 additions and 18 deletions

View File

@@ -46,7 +46,7 @@ export default Vue.extend({
});
},
upload(file: File, folder: any) {
upload(file: File, folder: any, name?: string) {
if (folder && typeof folder == 'object') folder = folder.id;
const id = Math.random();
@@ -61,7 +61,7 @@ export default Vue.extend({
const ctx = {
id: id,
name: file.name || 'untitled',
name: name || file.name || 'untitled',
progress: undefined,
img: window.URL.createObjectURL(file)
};
@@ -75,6 +75,7 @@ export default Vue.extend({
data.append('file', file);
if (folder) data.append('folderId', folder);
if (name) data.append('name', name);
const xhr = new XMLHttpRequest();
xhr.open('POST', apiUrl + '/drive/files/create', true);