From 4e364311f1a07e2359eff2a4412ac90140059076 Mon Sep 17 00:00:00 2001 From: Olivier Paroz Date: Fri, 29 May 2015 13:49:51 +0200 Subject: Get a 96x96 preview for file conflict resolution --- core/js/oc-dialogs.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index 0692a9df5ca..b1ad72d9206 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -381,9 +381,15 @@ var OCdialogs = { $replacementDiv.find('.mtime').text(formatDate(replacement.lastModifiedDate)); } var path = original.directory + '/' +original.name; - Files.lazyLoadPreview(path, original.mimetype, function(previewpath){ - $originalDiv.find('.icon').css('background-image','url('+previewpath+')'); - }, 96, 96, original.etag); + var urlSpec = { + file: path, + x: 96, + y: 96, + c: original.etag, + forceIcon: 0 + }; + var previewpath = OC.generateUrl('/core/preview.png?') + $.param(urlSpec); + $originalDiv.find('.icon').css('background-image','url('+previewpath+')'); getCroppedPreview(replacement).then( function(path){ $replacementDiv.find('.icon').css('background-image','url(' + path + ')'); -- cgit v1.2.3 From 6aeaa6954b5b753a04c678109f1df614a32b6fda Mon Sep 17 00:00:00 2001 From: Olivier Paroz Date: Fri, 29 May 2015 17:49:26 +0200 Subject: Fix for parenthesis --- 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 b1ad72d9206..8ebce841bea 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -389,7 +389,7 @@ var OCdialogs = { forceIcon: 0 }; var previewpath = OC.generateUrl('/core/preview.png?') + $.param(urlSpec); - $originalDiv.find('.icon').css('background-image','url('+previewpath+')'); + $originalDiv.find('.icon').css({"background-image": "url('" + previewpath + "')"}); getCroppedPreview(replacement).then( function(path){ $replacementDiv.find('.icon').css('background-image','url(' + path + ')'); -- cgit v1.2.3 From f05ac47eb65c1bb418d89636c660093c79e4bef5 Mon Sep 17 00:00:00 2001 From: Olivier Paroz Date: Fri, 29 May 2015 18:34:38 +0200 Subject: Escape single quotes --- core/js/oc-dialogs.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index 8ebce841bea..9f88c268369 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -389,6 +389,8 @@ var OCdialogs = { forceIcon: 0 }; var previewpath = OC.generateUrl('/core/preview.png?') + $.param(urlSpec); + // Escaping single quotes + previewpath = previewpath.replace(/'/g, "%27") $originalDiv.find('.icon').css({"background-image": "url('" + previewpath + "')"}); getCroppedPreview(replacement).then( function(path){ -- cgit v1.2.3