flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erikdebr...@apache.org
Subject svn commit: r1376841 - in /incubator/flex/utilities/trunk/installerBadge: html-template/index.template.html src/InstallApacheFlexBadge.mxml
Date Fri, 24 Aug 2012 06:57:20 GMT
Author: erikdebruin
Date: Fri Aug 24 06:57:19 2012
New Revision: 1376841

URL: http://svn.apache.org/viewvc?rev=1376841&view=rev
Log:
Fix issue where badge would not properly show and function when debugging from the local file
system.

Modified:
    incubator/flex/utilities/trunk/installerBadge/html-template/index.template.html
    incubator/flex/utilities/trunk/installerBadge/src/InstallApacheFlexBadge.mxml

Modified: incubator/flex/utilities/trunk/installerBadge/html-template/index.template.html
URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/installerBadge/html-template/index.template.html?rev=1376841&r1=1376840&r2=1376841&view=diff
==============================================================================
--- incubator/flex/utilities/trunk/installerBadge/html-template/index.template.html (original)
+++ incubator/flex/utilities/trunk/installerBadge/html-template/index.template.html Fri Aug
24 06:57:19 2012
@@ -52,19 +52,21 @@
         function init() {
             var prefix, theElement, theHeight, theWidth, widget;
             
-    		if (typeof window.innerWidth === 'number') {
-    			theHeight = window.innerHeight;
-    			theWidth = window.innerWidth;
-    		} else {
-        		theElement = window.document.documentElement;
-
-    			theHeight = theElement.clientHeight;
-    			theWidth = theElement.clientWidth;
-    		}
-
-            widget = document.getElementById("${application}");
-            widget.style.height = (theHeight - 2) + "px";
-            widget.style.width = (theWidth - 2) + "px";
+    		if (displayType() != "") {
+	    		if (typeof window.innerWidth === 'number') {
+	    			theHeight = window.innerHeight;
+	    			theWidth = window.innerWidth;
+	    		} else {
+	        		theElement = window.document.documentElement;
+	
+	    			theHeight = theElement.clientHeight;
+	    			theWidth = theElement.clientWidth;
+	    		}
+	
+	            widget = document.getElementById("${application}");
+	            widget.style.height = (theHeight - 2) + "px";
+	            widget.style.width = (theWidth - 2) + "px";
+	        }
         }
         
         swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
@@ -72,7 +74,7 @@
             allowfullscreen: "true" };
         attributes = { id: "${application}", name: "${application}" };
         
-        swfobject.embedSWF("${swf}.swf", "flashContent", "0", "0", 
+        swfobject.embedSWF("${swf}.swf", "flashContent", "300", "300", 
             swfVersionStr, "", {}, params, attributes);
         
         swfobject.createCSS("#flashContent", "display: block;");

Modified: incubator/flex/utilities/trunk/installerBadge/src/InstallApacheFlexBadge.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/installerBadge/src/InstallApacheFlexBadge.mxml?rev=1376841&r1=1376840&r2=1376841&view=diff
==============================================================================
--- incubator/flex/utilities/trunk/installerBadge/src/InstallApacheFlexBadge.mxml (original)
+++ incubator/flex/utilities/trunk/installerBadge/src/InstallApacheFlexBadge.mxml Fri Aug
24 06:57:19 2012
@@ -65,7 +65,7 @@ limitations under the License.
 		
 		private var _installerFileName:String;
 		
-		private var _internetUtil:InternetUtil;
+		private var _internetUtil:InternetUtil = InternetUtil.instance;
 		
 		private var _mirrorURLUtil:MirrorURLUtil = MirrorURLUtil.instance;
 
@@ -127,26 +127,12 @@ limitations under the License.
 			}
 			currentState = newStateName;
 			
-			_internetUtil = InternetUtil.instance;
-			
-			var localDomain:String = InternetUtil.getTLDFromURL(
-				ExternalInterface.call("function () { return window.location.hostname; }"));
-			
-			var remoteDomain:String = InternetUtil.getTLDFromURL(Constants.APACHE_FLEX_URL);
-
 			var url:String = Constants.APACHE_FLEX_URL + Constants.CONFIG_XML_NAME;
-			if (localDomain == remoteDomain)
-			{
-				_internetUtil.fetch(url, internetFetchResultHandler);
-			}
-			else
-			{
-				/*
-					Using a simple webservice (PHP + cUrl) to bypass cross domain
-					and security sandbox restrictions while developing.
-				*/
+			
+			if (useCURL())
 				_internetUtil.fetch("badgeConfigService.php", internetFetchResultHandler, "url=" + escape(url));
-			}
+			else
+				_internetUtil.fetch(url, internetFetchResultHandler);
 		}
 		
 		//----------------------------------
@@ -217,7 +203,26 @@ limitations under the License.
 			
 			navigateToURL(request, "_blank");
 		}
-		 
+		
+		//----------------------------------
+		//    useCURL
+		//----------------------------------
+		
+		private function useCURL():Boolean
+		{
+			/*
+				Using a simple webservice (PHP + cUrl) to bypass cross domain
+				and security sandbox restrictions while developing.
+			*/
+
+			var localDomain:String = InternetUtil.getTLDFromURL(
+				ExternalInterface.call("function () { return window.location.hostname; }"));
+
+			var remoteDomain:String = InternetUtil.getTLDFromURL(Constants.APACHE_FLEX_URL);
+
+			return (localDomain) && (localDomain != remoteDomain);
+		}
+		
 	]]></fx:Script>
 	
 	<fx:Declarations /> 



Mime
View raw message