[richfaces-svn-commits] JBoss Rich Faces SVN: r13921 - trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Wed Apr 29 12:06:20 EDT 2009


Author: pyaschenko
Date: 2009-04-29 12:06:20 -0400 (Wed, 29 Apr 2009)
New Revision: 13921

Modified:
   trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
Log:
https://jira.jboss.org/jira/browse/RF-6846

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	2009-04-29 16:02:45 UTC (rev 13920)
+++ trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js	2009-04-29 16:06:20 UTC (rev 13921)
@@ -53,7 +53,7 @@
 	new E('a',
 			{
 				'style':'', 
-				'onclick': function (context) { return 'var entry = FileUploadEntry.getComponent(this); entry.uploadObject.clear(entry); return false;';}, 
+				'onclick': function (context) { return 'var entry = FileUploadEntry.getComponent(this); entry.uploadObject.clear(entry, true); return false;';}, 
 				'className':function (context) { return 'rich-fileupload-anc ' + Richfaces.evalMacro("className", context); }, 
 				'href':'#'
 			},
@@ -774,14 +774,14 @@
 		return false;
 	},
 
-	clear: function(entry) {
+	clear: function(entry, isCancelButton) {
 	if (this.disabled) return;
 		if (entry) {
-			if (entry.state == FileUploadEntry.UPLOAD_SUCCESS) {
+			if (isCancelButton || entry.state == FileUploadEntry.UPLOAD_SUCCESS || entry.state == FileUploadEntry.INITIALIZED || entry.state == FileUploadEntry.UPLOAD_CANCELED) {
 				this.remove(entry);
 				if(this.events.onclear) {	
 		   			this.element.fire("rich:onclear", {entry : entry});
-				}
+				}				
 			}
 		} else {
 			//this.entries.length should be evaluated every time!
@@ -1183,7 +1183,7 @@
 				var params = {allowscriptaccess:true, menu: "false", wmode: "transparent", salign: "TL", scale: "noscale"};
 				
 				var attributes = {style:"position:absolute; top:0px; left:0px;"};
-				swfobject.embedSWF((window.location.protocol+"//"+ window.location.host+this.options.flashComponentUrl), oid, "100%", "100%", "9.0.28", false, flashvars, params, attributes);
+				swfobject.embedSWF(this.options.flashComponentUrl, oid, "100%", "100%", "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");
@@ -1277,7 +1277,6 @@
 	},
 	
 	_flashGetActionUrl: function (url, entry) {
-		url = window.location.protocol+"//"+ window.location.host+url;
 		var getParams = "_richfaces_upload_uid="+ encodeURI(entry.uid) + "&" + this.id + "=" + this.id + "&_richfaces_upload_file_indicator=true&_richfaces_size="+entry.size+"&_richfaces_send_http_error=true";
 		if (/\?/.test(url)) {
 			var i = url.indexOf("?");




More information about the richfaces-svn-commits mailing list