From 8899543b7f69ae831db09e29955b4365317c6235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 20 Sep 2013 14:28:33 +0200 Subject: [PATCH 1/5] use !== comparison --- apps/files/js/filelist.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 3c99e3876c7..a9297996778 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -804,7 +804,7 @@ $(document).ready(function(){ data.context.attr('data-mime',file.mime).attr('data-id',file.id); var permissions = data.context.data('permissions'); - if(permissions != file.permissions) { + if(permissions !== file.permissions) { data.context.attr('data-permissions', file.permissions); data.context.data('permissions', file.permissions); } From 3be8e3f8d3c6940be408b89f8266be89b81226cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 20 Sep 2013 14:28:59 +0200 Subject: [PATCH 2/5] remove obsolete comment --- apps/files/templates/index.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 245c7f142da..5e7ad41b0f0 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -19,8 +19,6 @@ - From 5a174eba8304680db8604592089804ab64e77258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 20 Sep 2013 14:29:45 +0200 Subject: [PATCH 3/5] use correct property for mimetype of existing files --- core/js/oc-dialogs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index ac37b109e76..e5e9f6dbb7d 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -294,7 +294,7 @@ var OCdialogs = { conflict.find('.replacement .mtime').text(formatDate(replacement.lastModifiedDate)); } var path = getPathForPreview(original.name); - lazyLoadPreview(path, original.type, function(previewpath){ + lazyLoadPreview(path, original.mime, function(previewpath){ conflict.find('.original .icon').css('background-image','url('+previewpath+')'); }, 96, 96); getCroppedPreview(replacement).then( From 0683372200aaf989b596e34a9864cd0c6dd980a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 20 Sep 2013 14:58:52 +0200 Subject: [PATCH 4/5] canceling individual uploads is currently impossible because there is no placeholder --- apps/files/js/file-upload.js | 20 -------------------- apps/files/js/fileactions.js | 15 +-------------- 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index b52221ac1fc..f1ef485fc3d 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -41,26 +41,6 @@ function supportAjaxUploadWithProgress() { */ OC.Upload = { _uploads: [], - /** - * cancels a single upload, - * @deprecated because it was only used when a file currently beeing uploaded was deleted. Now they are added after - * they have been uploaded. - * @param {string} dir - * @param {string} filename - * @returns {unresolved} - */ - cancelUpload:function(dir, filename) { - var self = this; - var deleted = false; - //FIXME _selections - jQuery.each(this._uploads, function(i, jqXHR) { - if (selection.dir === dir && selection.uploads[filename]) { - deleted = self.deleteSelectionUpload(selection, filename); - return false; // end searching through selections - } - }); - return deleted; - }, /** * deletes the jqHXR object from a data selection * @param {object} data diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index 67d3d5ead8d..e14e52eb6ca 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -177,20 +177,7 @@ $(document).ready(function () { FileActions.register('all', 'Delete', OC.PERMISSION_DELETE, function () { return OC.imagePath('core', 'actions/delete'); }, function (filename) { - if (OC.Upload.cancelUpload($('#dir').val(), filename)) { - if (filename.substr) { - filename = [filename]; - } - $.each(filename, function (index, file) { - var filename = $('tr').filterAttr('data-file', file); - filename.hide(); - filename.find('input[type="checkbox"]').removeAttr('checked'); - filename.removeClass('selected'); - }); - procesSelection(); - } else { - FileList.do_delete(filename); - } + FileList.do_delete(filename); $('.tipsy').remove(); }); From 4ccbace68df0150cdadaa8e680a7cb2639e8c628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 20 Sep 2013 14:59:17 +0200 Subject: [PATCH 5/5] remove double uri encoding --- apps/files/js/files.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 899bc6469e5..bffb354fce6 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -367,7 +367,7 @@ $(document).ready(function() { } }); } - + //scroll to and highlight preselected file if (getURLParameter('scrollto')) { FileList.scrollTo(getURLParameter('scrollto')); @@ -645,7 +645,7 @@ 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'); @@ -654,9 +654,9 @@ function lazyLoadPreview(path, mime, ready, width, height) { height = $('#filestable').data('preview-y'); } if( $('#publicUploadButtonMock').length ) { - var previewURL = OC.Router.generate('core_ajax_public_preview', {file: encodeURIComponent(path), x:width, y:height, t:$('#dirToken').val()}); + var previewURL = OC.Router.generate('core_ajax_public_preview', {file: path, x:width, y:height, t:$('#dirToken').val()}); } else { - var previewURL = OC.Router.generate('core_ajax_preview', {file: encodeURIComponent(path), x:width, y:height}); + var previewURL = OC.Router.generate('core_ajax_preview', {file: path, x:width, y:height}); } $.get(previewURL, function() { previewURL = previewURL.replace('(', '%28');