Author: pyaschenko
Date: 2008-06-28 05:26:51 -0400 (Sat, 28 Jun 2008)
New Revision: 9286
Modified:
trunk/ui/fileUpload/src/main/flash/FileUploadComponent.as
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/swf/fileUploadComponent.swf
Log:
http://jira.jboss.com/jira/browse/RF-3822
Modified: trunk/ui/fileUpload/src/main/flash/FileUploadComponent.as
===================================================================
--- trunk/ui/fileUpload/src/main/flash/FileUploadComponent.as 2008-06-28 08:56:22 UTC (rev
9285)
+++ trunk/ui/fileUpload/src/main/flash/FileUploadComponent.as 2008-06-28 09:26:51 UTC (rev
9286)
@@ -39,7 +39,6 @@
public function setProperties(properties:Object)
{
-
this.acceptedTypes = properties.acceptedTypes;
this.noDuplicate = properties.noDuplicate;
this.maxFiles = properties.maxFiles;
@@ -60,11 +59,12 @@
this.fileDataList.splice(index, 1);
}
- public function uploadFile(index, actionURL)
+ public function uploadFile(index, actionURL, postData)
{
var item: FileReference = fileRefList[index];
if (item)
{
+ if (postData) item["postData"] = postData;
item.upload(actionURL);
return item.size;
}
@@ -87,7 +87,6 @@
for (var i:Number = 0; i < list.length; i++) {
if (this.fileRefList.length==this.maxFiles) break;
item = list[i];
-
if (!this.checkFileType(item.type) || !this.checkDuplicated(item.name)) {
ExternalInterface.call(this.getComponentString()+"._flashFireEvent('ontyperejected',
{})");
continue;
@@ -96,7 +95,6 @@
this.fileRefList.push(item);
this.fileDataList.push("{creationDate:
"+this.getJSDateString(item.creationDate)+", creator:
'"+item.creator+"', modificationDate:
"+this.getJSDateString(item.modificationDate)+", name:
'"+item.name+"', size: "+item.size+", type:
'"+item.type+"'}");
}
-
ExternalInterface.call(this.getComponentString()+"._flashAdd(["+this.fileDataList.join(",")+"])");
}
@@ -143,10 +141,10 @@
return false;
}
- private function checkDuplicated (fileName) {
+ private function checkDuplicated (fileName:String) {
if (!this.noDuplicate) return true;
- for (var i = 0; i < this.fileDataList.length; i++) {
- if (fileName == this.fileDataList[i].name) {
+ for (var i = 0; i < this.fileRefList.length; i++) {
+ if (fileName == this.fileRefList[i].name) {
return false;
}
}
Modified:
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
===================================================================
---
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-06-28
08:56:22 UTC (rev 9285)
+++
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-06-28
09:26:51 UTC (rev 9286)
@@ -1065,7 +1065,7 @@
var flashvars = {fileUploadId:this.id};
var params = {allowscriptaccess:true};
var attributes = {};
- swfobject.embedSWF(this.options.flashComponentUrl, oid, "0", "0",
"8.0.0", false, flashvars, params, attributes);
+ swfobject.embedSWF(this.options.flashComponentUrl, oid, "0", "0",
"9.0.28", false, flashvars, params, attributes);
this.currentInput.parentNode.innerHTML = '<input type="text"
style="cursor: pointer; right: 0px; top: 0px; font-size: 10em; position: absolute;
padding: 0px" class="rich-fileupload-hidden"
id="'+this.id+':file"
name="'+this.id+':file"></input>'
this.currentInput = $(this.id + ":file");
Modified:
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/swf/fileUploadComponent.swf
===================================================================
(Binary files differ)