diff options
author | Morris Jobke <hey@morrisjobke.de> | 2014-12-12 08:34:28 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-12-12 08:34:28 +0100 |
commit | e969fe6b1222467349929523ea92192ca23f92d5 (patch) | |
tree | 67bbf63fbf671b19d18d4fe17517cc299a653c61 /apps/files/js | |
parent | 68932b30fd3347761ca75dd8b7289848b2d6b42e (diff) | |
parent | c615b3527f7c472afbc93d3293c7f467a99cbd0b (diff) | |
download | nextcloud-server-e969fe6b1222467349929523ea92192ca23f92d5.tar.gz nextcloud-server-e969fe6b1222467349929523ea92192ca23f92d5.zip |
Merge pull request #12698 from owncloud/handle_readonly_shared_files
Handle readonly shared files
Diffstat (limited to 'apps/files/js')
-rw-r--r-- | apps/files/js/file-upload.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index ab450dc5cac..9fe623075bc 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -175,7 +175,14 @@ OC.Upload = { * @param {function} callbacks.onCancel */ checkExistingFiles: function (selection, callbacks) { - // TODO check filelist before uploading and show dialog on conflicts, use callbacks + /* + $.each(selection.uploads, function(i, upload) { + var $row = OCA.Files.App.fileList.findFileEl(upload.files[0].name); + if ($row) { + // TODO check filelist before uploading and show dialog on conflicts, use callbacks + } + }); + */ callbacks.onNoConflicts(selection); }, @@ -417,11 +424,15 @@ OC.Upload = { data.textStatus = 'servererror'; data.errorThrown = t('files', 'Could not get result from server.'); fu._trigger('fail', e, data); + } else if (result[0].status === 'readonly') { + var original = result[0]; + var replacement = data.files[0]; + OC.dialogs.fileexists(data, original, replacement, OC.Upload); } else if (result[0].status === 'existserror') { //show "file already exists" dialog var original = result[0]; var replacement = data.files[0]; - OC.dialogs.fileexists(data, original, replacement, OC.Upload, fu); + OC.dialogs.fileexists(data, original, replacement, OC.Upload); } else if (result[0].status !== 'success') { //delete data.jqXHR; data.textStatus = 'servererror'; |