From 06ca8866663dc5f42e29f6fe02c1ecefe0deb293 Mon Sep 17 00:00:00 2001 From: Erik Winlof Date: Thu, 24 Jul 2008 16:08:33 +0000 Subject: [PATCH] Document preview - Added a cache token to avoid cache issues - Maximizes the panel to fit the window Uploader Possibility to generate multiple thumbnails on upload git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10012 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../alfresco/repository/upload/upload.post.js | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/upload/upload.post.js b/config/alfresco/templates/webscripts/org/alfresco/repository/upload/upload.post.js index 0ff7217731..2973f1c7bc 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/repository/upload/upload.post.js +++ b/config/alfresco/templates/webscripts/org/alfresco/repository/upload/upload.post.js @@ -3,7 +3,7 @@ var content = null; var mimetype = null; var siteId = null; var containerId = null; -var thumbnailName = null; +var thumbnailNames = null; // Upload specific var uploadDirectory = null; @@ -75,8 +75,8 @@ for each (field in formdata.fields) overwrite = field.value == "true"; break; - case "thumbnail": - thumbnailName = field.value; + case "thumbnails": + thumbnailNames = field.value; break; } } @@ -168,7 +168,7 @@ else var suffix = 1; var tmpFilename; while(existingFile !== null) - { + { tmpFilename = filename.substring(0, filename.lastIndexOf(".")) + "-" + suffix + filename.substring(filename.lastIndexOf(".")); existingFile = container.childByNamePath(uploadDirectory + tmpFilename); suffix++; @@ -193,9 +193,17 @@ else // Save new file newFile.save(); // Create thumbnail? - if (thumbnailName && thumbnailService.isThumbnailNameRegistered(thumbnailName)) + if (thumbnailNames != null) { - newFile.createThumbnail(thumbnailName, true); + var thumbnails = thumbnailNames.split(","); + for (var i = 0; i < thumbnails.length; i++) + { + var thumbnailName = thumbnails[i]; + if(thumbnailName != "" && thumbnailService.isThumbnailNameRegistered(thumbnailName)) + { + newFile.createThumbnail(thumbnailName, true); + } + } } model.document = newFile; }