aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js/files.js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-09-19 08:23:07 -0700
committerThomas Müller <thomas.mueller@tmit.eu>2013-09-19 08:23:07 -0700
commit09cfebe93653f9168bdfb8e480a47c50a28868ea (patch)
tree9370b9d5ac99f148d2bc724f76c805b772af7d2d /apps/files/js/files.js
parentbd5cb1d801a16933b7b75af5c514caec2afa5fef (diff)
parent7e0631b3b81a5669620122964d0326ead187de30 (diff)
downloadnextcloud-server-09cfebe93653f9168bdfb8e480a47c50a28868ea.tar.gz
nextcloud-server-09cfebe93653f9168bdfb8e480a47c50a28868ea.zip
Merge pull request #4766 from owncloud/fix_3728_with_file_exists_dialog
file upload conflicts dialog
Diffstat (limited to 'apps/files/js/files.js')
-rw-r--r--apps/files/js/files.js62
1 files changed, 23 insertions, 39 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index a4fdf383339..8ccb448abfb 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -1,31 +1,4 @@
-var uploadingFiles = {};
Files={
- cancelUpload:function(filename) {
- if(uploadingFiles[filename]) {
- uploadingFiles[filename].abort();
- delete uploadingFiles[filename];
- return true;
- }
- return false;
- },
- cancelUploads:function() {
- $.each(uploadingFiles,function(index,file) {
- if(typeof file['abort'] === 'function') {
- file.abort();
- var filename = $('tr').filterAttr('data-file',index);
- filename.hide();
- filename.find('input[type="checkbox"]').removeAttr('checked');
- filename.removeClass('selected');
- } else {
- $.each(file,function(i,f) {
- f.abort();
- delete file[i];
- });
- }
- delete uploadingFiles[index];
- });
- procesSelection();
- },
updateMaxUploadFilesize:function(response) {
if(response == undefined) {
return;
@@ -208,7 +181,8 @@ $(document).ready(function() {
// Trigger cancelling of file upload
$('#uploadprogresswrapper .stop').on('click', function() {
- Files.cancelUploads();
+ OC.Upload.cancelUploads();
+ procesSelection();
});
// Show trash bin
@@ -530,7 +504,7 @@ var folderDropOptions={
$('#notification').fadeIn();
}
} else {
- OC.dialogs.alert(t('Error moving file'), t('core', 'Error'));
+ OC.dialogs.alert(t('files', 'Error moving file'), t('files', 'Error'));
}
});
});
@@ -568,7 +542,7 @@ var crumbDropOptions={
$('#notification').fadeIn();
}
} else {
- OC.dialogs.alert(t('Error moving file'), t('core', 'Error'));
+ OC.dialogs.alert(t('files', 'Error moving file'), t('files', 'Error'));
}
});
});
@@ -658,15 +632,25 @@ function getPathForPreview(name) {
return path;
}
-function lazyLoadPreview(path, mime, ready) {
- getMimeIcon(mime,ready);
- var x = $('#filestable').data('preview-x');
- var y = $('#filestable').data('preview-y');
- var previewURL = OC.Router.generate('core_ajax_preview', {file: encodeURIComponent(path), x:x, y:y});
- $.get(previewURL, function() {
- previewURL = previewURL.replace('(','%28');
- previewURL = previewURL.replace(')','%29');
- ready(previewURL + '&reload=true');
+function lazyLoadPreview(path, mime, ready, width, height) {
+ // get mime icon url
+ getMimeIcon(mime, function(iconURL) {
+ ready(iconURL); // set mimeicon URL
+
+ // now try getting a preview thumbnail URL
+ if ( ! width ) {
+ width = $('#filestable').data('preview-x');
+ }
+ if ( ! height ) {
+ height = $('#filestable').data('preview-y');
+ }
+ var previewURL = OC.Router.generate('core_ajax_preview', {file: encodeURIComponent(path), x:width, y:height});
+ $.get(previewURL, function() {
+ previewURL = previewURL.replace('(', '%28');
+ previewURL = previewURL.replace(')', '%29');
+ //set preview thumbnail URL
+ ready(previewURL + '&reload=true');
+ });
});
}