You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2012/12/20 19:56:53 UTC

svn commit: r1424634 - /incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/components/upload/fileUpload.lzx

Author: solomax
Date: Thu Dec 20 18:56:52 2012
New Revision: 1424634

URL: http://svn.apache.org/viewvc?rev=1424634&view=rev
Log:
fileUpload is fixed to correctly display 'Allowed Files' mask

Modified:
    incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/components/upload/fileUpload.lzx

Modified: incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/components/upload/fileUpload.lzx
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/components/upload/fileUpload.lzx?rev=1424634&r1=1424633&r2=1424634&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/components/upload/fileUpload.lzx (original)
+++ incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/components/upload/fileUpload.lzx Thu Dec 20 18:56:52 2012
@@ -42,7 +42,6 @@
 		<handler name="oninit" args="invoker">
 		<![CDATA[
 			this.fr = new flash.net.FileReference();	
-			//if ($debug) Debug.write(fr);
     		this.fr.onHTTPError = function(fr, httpError){
                 var t = _root;
             	if ($debug) t.Debug.write('onHTTPError function: ' + httpError);
@@ -68,52 +67,42 @@
 
 		<method name="browse">
 		<![CDATA[	
-		
+			var zipExt = "*.zip"
+				, profileExt = "*.psd;*.tiff;*.bmp;*.svg;*.dpx;*.exr;*.jpg;*.jpeg;*.gif;*.png"
+				, pptExt = "*.ppt;*.odp;"
+				, docExt = pptExt + ";*.txt;*.pptx;*.odt;*.wpd;*.doc;*.docx;*.rtf;*.ods;*.sxc;*.xls;*.xlsx;*.sxi;*.pdf"
+				, vidExt = "*.avi;*.mov;*.flv;*.mp4"
+				, imgExt = profileExt + ";*.tga;*.xcf;*.wpg;*.ico;*.ttf;*.pcd;*.pcds;*.ps"
+				, allExt = docExt + ";" + vidExt + ";" + imgExt;
+
 			if (this.isOnlyZip) {
 				
 				var allTypes = new Array();
 				var imageTypes = new Object();
 				imageTypes.description = "ZIP (*.zip)";
-				imageTypes.extension = "*.zip";
+				imageTypes.extension = zipExt;
 				allTypes.push(imageTypes); 				
 				fr.browse(allTypes);
 				
 			} else if(this.isOnlyProfile){	
 				var allTypes = new Array();
 				var imageTypes = new Object();
-				imageTypes.description = "Allowed Files (*.psd, *.tiff, *.bmp, *.svg, *.dpx, *.exr, *.jpg, *.jpeg, *.gif, *.png)";
-				imageTypes.extension = "*.psd; *.tiff; *.bmp; *.svg; *.dpx; *.exr; *.jpg; *.jpeg; *.gif; *.png";
+				imageTypes.description = "Allowed Files (" + profileExt + ")";
+				imageTypes.extension = profileExt;
 				allTypes.push(imageTypes); 				
 				fr.browse(allTypes);
 			} else if (this.isOnlyImage){
-				var allTypes = new Array();
-
-				var imageTypes = new Object();
-				imageTypes.description = "Allowed Files";
-				imageTypes.extension = "*.txt; *.ppt; *.pptx; *.odp; *.odt; *.wpd; *.doc; *.docx; *.rtf; *.txt; *.ods; *.sxc; *.xls; *.xlsx; *.sxi; *.pdf; *.avi; *.mov; *.flv; *.mp4; *.tga; *.xcf; *.wpg; *.ico; *.ttf; *.pcd; *.pcds; *.ps; *.psd; *.tiff; *.bmp; *.svg; *.dpx; *.exr; *.jpg; *.jpeg; *.gif; *.png";
-				allTypes.push(imageTypes); 
-				
-				imageTypes = new Object();
-				imageTypes.extension = "*.txt; *.ppt; *.pptx; *.odp; *.odt; *.wpd; *.doc; *.docx; *.rtf; *.txt; *.ods; *.sxc; *.xls; *.xlsx; *.sxi; *.pdf";
-				imageTypes.description = "Documents";
-				allTypes.push(imageTypes);
-				
-				imageTypes = new Object();
-                imageTypes.extension = "*.avi; *.mov; *.flv; *.mp4";
-                imageTypes.description = "Videos";
-                allTypes.push(imageTypes);
-				
-				imageTypes = new Object();
-				imageTypes.extension = "*.tga; *.xcf; *.wpg; *.ico; *.ttf; *.pcd; *.pcds; *.ps; *.psd; *.tiff; *.bmp; *.svg; *.dpx; *.exr; *.jpg; *.jpeg; *.gif; *.png";
-				imageTypes.description = "Pictures";
-				allTypes.push(imageTypes);
-
-				fr.browse(allTypes);	
+				fr.browse([
+					{description: "Allowed Files", extension: allExt}
+					, {description: "Documents", extension: docExt}
+					, {description: "Videos", extension: vidExt}
+					, {description: "Pictures", extension: imgExt}
+				]);
 			} else if(this.isOnlyPpt){	
 				var allTypes = new Array();
 				var imageTypes = new Object();
-				imageTypes.description = "Powerpoint (*.ppt, *.odp)";
-				imageTypes.extension = "*.ppt; *.odp;";
+				imageTypes.description = "Powerpoint (" + pptExt + ")";
+				imageTypes.extension = pptExt;
 				allTypes.push(imageTypes); 				
 				fr.browse(allTypes);
 			} else if(this.isOnlyXml){