mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user