incubator-flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erikdebr...@apache.org
Subject svn commit: r1382466 - /incubator/flex/site/trunk/content/flex/installerbadge/index.chtml
Date Sun, 09 Sep 2012 11:47:32 GMT
Author: erikdebruin
Date: Sun Sep  9 11:47:32 2012
New Revision: 1382466

URL: http://svn.apache.org/viewvc?rev=1382466&view=rev
Log:
Minor update to fix sizing problem on the small version of the badge.

Modified:
    incubator/flex/site/trunk/content/flex/installerbadge/index.chtml

Modified: incubator/flex/site/trunk/content/flex/installerbadge/index.chtml
URL: http://svn.apache.org/viewvc/incubator/flex/site/trunk/content/flex/installerbadge/index.chtml?rev=1382466&r1=1382465&r2=1382466&view=diff
==============================================================================
--- incubator/flex/site/trunk/content/flex/installerbadge/index.chtml (original)
+++ incubator/flex/site/trunk/content/flex/installerbadge/index.chtml Sun Sep  9 11:47:32
2012
@@ -1,10 +1,3 @@
-<style type="text/css"> 
-    body { margin: 0; padding: 0; }   
-    object:focus { outline: none; }
-    #flashContent { display: none; }
-    #${application} { border: 1px solid #172647; }
-</style>
-
 <div id="flashContent">
     <script type="text/javascript"> 
         var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://");

@@ -22,7 +15,7 @@
 <script type="text/javascript">
     /* use strict */
     
-    var swfVersionStr, params, attributes;
+    var _widget;
     
     function displayType() {
         if ((window.top != window.self) && window.parent)
@@ -32,7 +25,7 @@
     }
     
     function init() {
-        var prefix, theElement, theHeight, theWidth, widget;
+        var prefix, theElement, theHeight, theWidth;
         
 		if (displayType() != "") {
     		if (typeof window.innerWidth === 'number') {
@@ -45,27 +38,39 @@
     			theWidth = theElement.clientWidth;
     		}
 
-            widget = document.getElementById("InstallApacheFlexBadge");
-
-            console.log("HERE '" + widget + "'");
+           console.log("HERE '" + _widget + "'");
 
-            widget.style.height = (theHeight - 2) + "px";
-            widget.style.width = (theWidth - 2) + "px";
+            _widget.style.height = (theHeight - 2) + "px";
+            _widget.style.width = (theWidth - 2) + "px";
             
             document.getElementById("InstallApacheFlexBadge").style.border = "1px solid #172647";
         }
     }
     
-    swfVersionStr = "11.1.0";
-    flashVars = { serviceURL: "http://incubator.apache.org/flex/" };
-    params = { quality: "high", bgcolor: "#ffffff", allowscriptaccess: "sameDomain",
-        allowfullscreen: "true" };
-    attributes = { id: "InstallApacheFlexBadge", name: "InstallApacheFlexBadge" };
+    function start() {
+        var swfVersionStr, params, attributes;
+        
+        swfVersionStr = "11.1.0";
+        flashVars = { serviceURL: "http://incubator.apache.org/flex/" };
+        params = { quality: "high", bgcolor: "#ffffff", allowscriptaccess: "sameDomain",
+            allowfullscreen: "true" };
+        attributes = { id: "InstallApacheFlexBadge", name: "InstallApacheFlexBadge" };
+    
+        swfobject.embedSWF("InstallApacheFlexBadge.swf", "flashContent", "10", "10", 
+            swfVersionStr, "", flashVars, params, attributes);
+    
+        swfobject.createCSS("#flashContent", "display: block;");
     
-    swfobject.embedSWF("InstallApacheFlexBadge.swf", "flashContent", "10", "10", 
-        swfVersionStr, "", flashVars, params, attributes);
+        waitForWidget();
+    }
+    
+    function waitForWidget() {
+        _widget = document.getElementById("InstallApacheFlexBadge");
+        
+        if (!_widget)
+            setTimeout(function () { waitForWidget(); }, 1000);
+    }
     
-    swfobject.createCSS("#flashContent", "display: block;");
+    start();
     
-    setTimeout(function () { init(); }, 1000);
 </script>



Mime
View raw message