2 Replies Latest reply on Apr 12, 2016 2:03 AM by jiggy1965

    How to move javascript into html?

    jiggy1965 Level 1

      I need to create a self-contained html banner in Edge Animate. For this I have already encoded the images to base24. I just need to include the javascript into that html. When I publish my banner, Edge by default adds a 'edge_includes' folder which contains 'edge.6.0.0.min.js' and a javascript file in the same location as the html file which is called the same as the html file but with a '_edge.js' extention. Like for example 'text_edge.js'. Both .js files need to be moved to the published html file.

       

      The 'edge.6.0.0.min.js' file I can move easily enough by moving it's script between the script tags of the html file which mentions that .js file.

       

      The test_edge.js file however is more difficult. A typical published html file contains this amongst others:

       

      <script>    AdobeEdge.loadComposition('test', 'EDGE-102396420', {
          scaleToFit: "none",
          centerStage: "none",
          minW: "0px",
          maxW: "undefined",
          width: "300px",
          height: "250px" }, {"dom":{}}, {"dom":{}}); 
      </script>
      

       

      This is - I guess - where Edge loads that 'test_edge.js' file, through 'loadComposition'. But how can I copy the contents of that test_edge.js file into my html file then? I can't replace 'test' with the contents of 'test_edge.js' for example. Is there some other way to load that file's content into my html file? By coping it between script tags and making loadComposition load that scripted part instead of the external test_edge.js file for example?

        • 1. Re: How to move javascript into html?
          jiggy1965 Level 1

          So this is an example of such a {project name}_edge.js file that I wish to add/move to my single html file:

           

          (function(compId){var _=null,y=true,n=false,x1='6.0.0',x2='5.0.0',x4='rgba(0,0,0,0)',x6='rgba(255,255,255,1)',g ='image',x3='6.0.0.400',i='none';var g5='hangmat.png';var im='images/',aud='media/',vid='media/',js='js/',fonts={},opts={'gAudioPreloadPreference': 'auto','gVideoPreloadPreference':'auto'},resources=[],scripts=[],symbols={"stage":{v:x1,mv :x2,b:x3,stf:i,cg:i,rI:n,cn:{dom:[{id:'hangmat',t:g,r:['8px','45px','275px','172px','auto' ,'auto'],f:[x4,im+g5,'0px','0px']}],style:{'${Stage}':{isStage:true,r:['null','null','300p x','250px','auto','auto'],overflow:'hidden',f:[x6]}}},tt:{d:0,a:y,data:[]}}};AdobeEdge.reg isterCompositionDefn(compId,symbols,fonts,scripts,resources,opts);})("EDGE-102396420");

          (function($,Edge,compId){var Composition=Edge.Composition,Symbol=Edge.Symbol;Edge.registerEventBinding(compId,function ($){

          //Edge symbol: 'stage'

          (function(symbolName){})("stage");

          //Edge symbol end:'stage'

          })})(AdobeEdge.$,AdobeEdge,"EDGE-102396420");

           

          Edge loads this by default using:

          AdobeEdge.loadComposition('test', 'EDGE-102396420',

           

          This makes it search for the text_edge.js file and it loads that content with this. But as I said: I wish to move this part into my html file and instead of that html file looking for that test_edge.js file to load, I wish to have it load that content that is now already in the html itself.

           

          Can this be done somehow? In the end I want to have a single self contained html file with all assets (base24) and all js files embedded in it. So I can delete all those external files and just end up with a single html file. Who can help me figure this out? Or can't it be done?

          • 2. Re: How to move javascript into html?
            jiggy1965 Level 1

            Basically I wish to have something like below image. I want to copy the contents of test_edge.js into my html and delete that test_edge.js file afterwards. Now somehow I have to make AdobeEdge.loadComposition load the contents of script tags with id 'test' instead of looking for that external test_edge.js file. Any way for me to do that?

             

            Schermafbeelding 2016-04-12 om 10.58.13.png