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:
Erik Winlof
2008-07-24 16:08:33 +00:00
parent 2e2642cb7d
commit 06ca886666

View File

@@ -3,7 +3,7 @@ var content = null;
var mimetype = null; var mimetype = null;
var siteId = null; var siteId = null;
var containerId = null; var containerId = null;
var thumbnailName = null; var thumbnailNames = null;
// Upload specific // Upload specific
var uploadDirectory = null; var uploadDirectory = null;
@@ -75,8 +75,8 @@ for each (field in formdata.fields)
overwrite = field.value == "true"; overwrite = field.value == "true";
break; break;
case "thumbnail": case "thumbnails":
thumbnailName = field.value; thumbnailNames = field.value;
break; break;
} }
} }
@@ -168,7 +168,7 @@ else
var suffix = 1; var suffix = 1;
var tmpFilename; var tmpFilename;
while(existingFile !== null) while(existingFile !== null)
{ {
tmpFilename = filename.substring(0, filename.lastIndexOf(".")) + "-" + suffix + filename.substring(filename.lastIndexOf(".")); tmpFilename = filename.substring(0, filename.lastIndexOf(".")) + "-" + suffix + filename.substring(filename.lastIndexOf("."));
existingFile = container.childByNamePath(uploadDirectory + tmpFilename); existingFile = container.childByNamePath(uploadDirectory + tmpFilename);
suffix++; suffix++;
@@ -193,9 +193,17 @@ else
// Save new file // Save new file
newFile.save(); newFile.save();
// Create thumbnail? // 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; model.document = newFile;
} }