diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-03-02 21:06:25 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-03-02 21:06:25 +0100 |
commit | acabd81f42457d1a4c9e12663e2c65bd558c1896 (patch) | |
tree | 770e627669b5e13e1e4eb313c5155e2c929239cb /apps/files/js | |
parent | 1155ad6e389e47e110a415f22eddda1570dc9ff2 (diff) | |
download | nextcloud-server-acabd81f42457d1a4c9e12663e2c65bd558c1896.tar.gz nextcloud-server-acabd81f42457d1a4c9e12663e2c65bd558c1896.zip |
Remove "Download from URL" feature
Fixes https://github.com/owncloud/core/issues/13326
Diffstat (limited to 'apps/files/js')
-rw-r--r-- | apps/files/js/file-upload.js | 54 |
1 files changed, 1 insertions, 53 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 7374a4c90f3..4e0b9e0e6d1 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -602,9 +602,7 @@ OC.Upload = { var lastPos; var checkInput = function () { var filename = input.val(); - if (type === 'web' && filename.length === 0) { - throw t('files', 'URL cannot be empty'); - } else if (type !== 'web' && ! Files.isFileNameValid(filename)) { + if (Files.isFileNameValid(filename)) { // Files.isFileNameValid(filename) throws an exception itself } else if (FileList.inList(filename)) { throw t('files', '{new_name} already exists', {new_name: filename}); @@ -683,56 +681,6 @@ OC.Upload = { } ); break; - case 'web': - if (name.substr(0, 8) !== 'https://' && name.substr(0, 7) !== 'http://') { - name = 'http://' + name; - } - var localName = name; - if (localName.substr(localName.length-1, 1) === '/') {//strip / - localName = localName.substr(0, localName.length-1); - } - if (localName.indexOf('/')) { //use last part of url - localName = localName.split('/').pop(); - } else { //or the domain - localName = (localName.match(/:\/\/(.[^\/]+)/)[1]).replace('www.', ''); - } - localName = FileList.getUniqueName(localName); - //IE < 10 does not fire the necessary events for the progress bar. - if ($('html.lte9').length === 0) { - $('#uploadprogressbar').progressbar({value: 0}); - OC.Upload._showProgressBar(); - } - - var eventSource = new OC.EventSource( - OC.filePath('files', 'ajax', 'newfile.php'), - { - dir: FileList.getCurrentDirectory(), - source: name, - filename: localName - } - ); - eventSource.listen('progress', function(progress) { - //IE < 10 does not fire the necessary events for the progress bar. - if ($('html.lte9').length === 0) { - $('#uploadprogressbar').progressbar('value',progress); - } - }); - eventSource.listen('success', function(data) { - var file = data; - OC.Upload._hideProgressBar(); - - FileList.add(file, {hidden: hidden, animate: true}); - }); - eventSource.listen('error', function(error) { - OC.Upload._hideProgressBar(); - var message = (error && error.message) || t('core', 'Error fetching URL'); - OC.Notification.show(message); - //hide notification after 10 sec - setTimeout(function() { - OC.Notification.hide(); - }, 10000); - }); - break; } var li = form.parent(); form.remove(); |