Added setup HTML to 'fake' the initialization of the application by the Flash 
Player

Signed-off-by: Erik de Bruin <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/5eee1b19
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/5eee1b19
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/5eee1b19

Branch: refs/heads/develop
Commit: 5eee1b1956f4d4e92a8ee43f438711c8ddb9236b
Parents: b602955
Author: Erik de Bruin <[email protected]>
Authored: Fri Oct 31 17:40:58 2014 +0100
Committer: Erik de Bruin <[email protected]>
Committed: Fri Oct 31 17:44:04 2014 +0100

----------------------------------------------------------------------
 .../codegen/mxml/vf2js/MXMLVF2JSPublisher.java  | 21 ++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/5eee1b19/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSPublisher.java
----------------------------------------------------------------------
diff --git 
a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSPublisher.java
 
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSPublisher.java
index 5299df1..3c44bd0 100644
--- 
a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSPublisher.java
+++ 
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSPublisher.java
@@ -134,7 +134,7 @@ public class MXMLVF2JSPublisher extends JSGoogPublisher 
implements
     public boolean publish(ProblemQuery problems) throws IOException
     {
         boolean ok = true;
-        boolean subsetGoog = false;
+        boolean subsetGoog = true;
         
         final String intermediateDirPath = outputFolder.getPath();
         final File intermediateDir = new File(intermediateDirPath);
@@ -472,10 +472,10 @@ public class MXMLVF2JSPublisher extends JSGoogPublisher 
implements
             htmlFile.append("\t<script type=\"text/javascript\" 
src=\"./library/closure/goog/base.js\"></script>\n");
             htmlFile.append("\t<script type=\"text/javascript\" 
src=\"./sdk-deps.js\"></script>\n");
             htmlFile.append("\t<script type=\"text/javascript\">\n");
-            htmlFile.append("\t\tgoog.require(");
-            htmlFile.append("'mx.managers.SystemManager'");
-            //htmlFile.append(projectName);
-            htmlFile.append(");\n");
+            
//htmlFile.append("\t\tgoog.require('mx.styles.StyleProtoChain');\n");
+            
htmlFile.append("\t\tgoog.require('mx.managers.SystemManager');\n");
+            
htmlFile.append("\t\tgoog.require('mx.managers.systemClasses.ChildManager');\n");
+            //htmlFile.append("\t\tgoog.require('" + projectName + "');\n");
             htmlFile.append("\t</script>\n");
         }
         else
@@ -493,7 +493,8 @@ public class MXMLVF2JSPublisher extends JSGoogPublisher 
implements
         htmlFile.append("\t\tfunction init() {\n");
         htmlFile.append("\t\t\tvar /** @type {flash.display.LoaderInfo} */ 
loaderInfo,\n");
         htmlFile.append("\t\t\t    /** @type {flash.display.Stage} */ 
stage,\n");
-        htmlFile.append("\t\t\t    /** @type {mx.managers.SystemManager} */ 
systemManager;\n");
+        htmlFile.append("\t\t\t    /** @type {mx.managers.SystemManager} */ 
systemManager,\n");
+        htmlFile.append("\t\t\t    /** @type 
{mx.managers.systemClasses.ChildManager} */ childManager;\n");
         htmlFile.append("\t\t\t\n");
         htmlFile.append("\t\t\tstage = new flash.display.Stage();\n");
         htmlFile.append("\t\t\twindow['apache-flex_stage'] = stage;\n");
@@ -519,6 +520,8 @@ public class MXMLVF2JSPublisher extends JSGoogPublisher 
implements
         htmlFile.append("\t\t\t        infoObject[\"backgroundImage\"] = 
'';\n");
         htmlFile.append("\t\t\t        infoObject[\"backgroundSize\"] = 
'';\n");
         htmlFile.append("\t\t\t        infoObject[\"cdRsls\"] = '';\n");
+        htmlFile.append("\t\t\t        infoObject[\"compiledLocales\"] = 
'';\n");
+        htmlFile.append("\t\t\t        
infoObject[\"compiledResourceBundleNames\"] = '';\n");
         htmlFile.append("\t\t\t        infoObject[\"currentDomain\"] = new 
flash.system.ApplicationDomain();\n");
         htmlFile.append("\t\t\t        infoObject[\"fonts\"] = '';\n");
         htmlFile.append("\t\t\t        infoObject[\"frames\"] = '';\n");
@@ -533,6 +536,12 @@ public class MXMLVF2JSPublisher extends JSGoogPublisher 
implements
         htmlFile.append("\t\t\t        return infoObject;\n");
         htmlFile.append("\t\t\t}\n");
         htmlFile.append("\t\t\t\n");
+        htmlFile.append("\t\t\tchildManager = new 
mx.managers.systemClasses.ChildManager(systemManager);\n");
+        htmlFile.append("\t\t\t\n");
+        htmlFile.append("\t\t\tmx.managers.DragManagerImpl.sm = 
window['apache-flex_system-manager'];\n");
+        htmlFile.append("\t\t\t\n");
+        htmlFile.append("\t\t\tmx.core.FlexGlobals.topLevelApplication = 
{};\n");
+        htmlFile.append("\t\t\t\n");
         
htmlFile.append("\t\t\twindow['apache-flex_loaderInfo'].dispatchEvent(new 
flash.events.Event(flash.events.Event.INIT));\n");
         htmlFile.append("\t\t}\n");
         htmlFile.append("\t</script>\n");

Reply via email to