Changeset 7262

Show
Ignore:
Timestamp:
02/08/07 22:18:09 (19 months ago)
Author:
jburke
Message:

(merge from branch) References #2366. More web build plumbing. Got file save to work. UI still needs lots of work

Location:
trunk/buildscripts
Files:
2 modified
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/buildscripts/webbuild/index.html

    r7184 r7262  
    1616                } 
    1717 
     18                #xdDojoUrlDisplay { 
     19                        display: none; 
     20                } 
    1821        </style> 
    1922        <script type="text/javascript"> 
     
    3235                dojo.require("dojo.widget.TreeSelectorV3"); 
    3336                dojo.require("dojo.widget.TreeEmphasizeOnSelect"); 
    34          
     37                dojo.require("dojo.html.iframe"); 
     38 
    3539                function output(message){ 
    3640                        dojo.debug(message); 
     41                } 
     42 
     43                function sendDependencyResultToServer(dependencyResult){ 
     44                        var depListForm = document.depListForm; 
     45                        depListForm.action = "../webbuild.php"; 
     46                        depListForm.depList.value = dependencyResult.depList.join(","); 
     47                        depListForm.provideList.value = dependencyResult.provideList.join(","); 
     48                        depListForm.version.value = version; 
     49                        depListForm.xdDojoUrl.value = xdDojoUrl; 
     50 
     51                        //reset the hidden frame so we can do another build. 
     52                        setTimeout(function(){ 
     53                                dojo.html.iframeContentWindow(dojo.byId("builderFrame")).location = "../webbuild.html?random=" + (new Date()).getTime(); 
     54                        }, 1000); 
     55 
     56                        depListForm.submit(); 
    3757                } 
    3858 
     
    6484                         
    6585                        //Set up XD Dojo URL if available. 
    66                         var xdDojoUrl = "@XD_DOJO_URL@"; 
     86                        xdDojoUrl = "@XD_DOJO_URL@"; 
    6787                        if(xdDojoUrl != ("@" + "XD_DOJO_URL" + "@")){ 
    68                                 dojo.byId("xdDojoPath").value = xdDojoUrl; 
     88                                dojo.byId("xdDojoUrl").innerHTML = xdDojoUrl; 
     89                                dojo.byId("xdDojoUrlDisplay").style.display = "block"; 
     90                        }else{ 
     91                                xdDojoUrl = ""; 
    6992                        } 
     93                         
     94                        version = "@VERSION@"; 
     95                        if(xdDojoUrl == ("@" + "VERSION" + "@")){ 
     96                                version = ""; 
     97                        } 
     98 
    7099                }); 
    71100        </script> 
     
    82111        </div> 
    83112        <div id="buildControls"> 
    84                 <p> 
    85                         <b>XDomain Dojo path (example: http://some.domain.com/dojo-xdversion/src):</b><br /> 
    86                         <input type="text" id="xdDojoPath" value="" size="30" /> 
     113                <p id="xdDojoUrlDisplay"> 
     114                        <b>XDomain Dojo path:</b><br /> 
     115                        <span id="xdDojoUrl"></span> 
    87116                </p> 
    88117                <p> 
     
    96125                </p> 
    97126                <p> 
    98                         <button onclick="builderFrame.startBuild(dojo.byId('dependencyList').value, '0.4.2dev', dojo.byId('xdDojoPath').value)">Go</button> 
     127                        <button onclick="builderFrame.startBuild(dojo.byId('dependencyList').value, version, xdDojoUrl)">Go</button> 
    99128                </p> 
    100129        </div> 
     
    104133        </div> 
    105134 
     135        <form name="depListForm" action="" method="POST"> 
     136                <input type="hidden" name="depList" value="" /> 
     137                <input type="hidden" name="provideList" value="" /> 
     138                <input type="hidden" name="version" value="" />          
     139                <input type="hidden" name="compress" value="false" /> 
     140                <input type="hidden" name="xdDojoUrl" value="" /> 
     141        </form> 
     142 
    106143        <iframe id="builderFrame" name="builderFrame" src="../webbuild.html" style="visibility: hidden"></iframe> 
    107144</body> 
  • trunk/buildscripts/webbuild/webbuild.js

    r7187 r7262  
    4242                 
    4343                var dependencyResult = buildUtil.getDependencyList(dependencies, null, true); 
    44                 var dojoResult = buildUtil.makeDojoJs(dependencyResult, version); 
     44                 
     45                if(location.toString().indexOf("file:") == 0){ 
     46                        var dojoResult = buildUtil.makeDojoJs(dependencyResult, version); 
     47         
     48                        //Intern strings, and add license 
     49                        dojoResult.dojoContents = new String(readFile("copyright.txt")) + buildUtil.interningRegexpMagic("xdomain", dojoResult.dojoContents, djConfig.baseRelativePath, [["dojo", "src"]], []); 
     50         
     51                        //Print out the file list. 
     52                        dojo.debug("files in the profile:"); 
     53                        for(var i = 0; i < dojoResult.resourceDependencies.length; i++){ 
     54                                print(dojoResult.resourceDependencies[i]); 
     55                        } 
     56                         
     57                        //Return the dojo contents 
     58                        webbuild.dojoContents = dojoResult.dojoContents; 
     59         
     60                        //See if we should add in xd dojo module path. 
     61                        xdDojoPath = dojo.string.trim(xdDojoPath); 
     62                        if(xdDojoPath){ 
     63                                webbuild.dojoContents = buildUtilXd.setXdDojoConfig(webbuild.dojoContents, xdDojoPath); 
     64                        } 
    4565 
    46                 //Intern strings, and add license 
    47                 dojoResult.dojoContents = new String(readFile("copyright.txt")) + buildUtil.interningRegexpMagic("xdomain", dojoResult.dojoContents, djConfig.baseRelativePath, [["dojo", "src"]], []); 
     66                        var outputWindow = window.open("webbuild/dojo.js.html", "dojoOutput"); 
     67                        outputWindow.focus(); 
     68         
     69                        //FAILED attempts: 
     70                        //Using a javascript: url, FF 2.0 wraps the content in some HTML, so not really 
     71                        //good for file save operations (get HTML in the saved file). 
     72                        //var outputWindow = window.open("javascript:opener.webbuild.getDojoContents()", "dojoOutput"); 
     73         
     74                        //using data: urls seem to add funky text to the beginning of the file, at least in OSX FF 2.0 
     75                        //Same issue if application/octet-stream is used instead of text/javascript. 
     76                        //var outputWindow = window.open("data:text/javascript;" + webbuild.dojoContents, "dojoOutput"); 
     77                }else{ 
     78                        parent.sendDependencyResultToServer(dependencyResult); 
     79                } 
     80        }, 
    4881 
    49                 //Print out the file list. 
    50                 dojo.debug("files in the profile:"); 
    51                 for(var i = 0; i < dojoResult.resourceDependencies.length; i++){ 
    52                         print(dojoResult.resourceDependencies[i]); 
    53                 } 
    54                  
    55                 //Return the dojo contents 
    56                 webbuild.dojoContents = dojoResult.dojoContents; 
    57  
    58                 //See if we should add in xd dojo module path. 
    59                 xdDojoPath = dojo.string.trim(xdDojoPath); 
    60                 if(xdDojoPath){ 
    61                         webbuild.dojoContents = buildUtilXd.setXdDojoConfig(webbuild.dojoContents, xdDojoPath); 
    62                 } 
    63  
    64  
    65  
    66                 var outputWindow = window.open("webbuild/dojo.js.html", "dojoOutput"); 
    67                 outputWindow.focus(); 
    68  
    69                 //FAILED attempts: 
    70                 //Using a javascript: url, FF 2.0 wraps the content in some HTML, so not really 
    71                 //good for file save operations (get HTML in the saved file). 
    72                 //var outputWindow = window.open("javascript:opener.webbuild.getDojoContents()", "dojoOutput"); 
    73  
    74                 //using data: urls seem to add funky text to the beginning of the file, at least in OSX FF 2.0 
    75                 //Same issue if application/octet-stream is used instead of text/javascript. 
    76                 //var outputWindow = window.open("data:text/javascript;" + webbuild.dojoContents, "dojoOutput"); 
    77         }, 
    78          
    7982        getDojoContents: function(){ 
    8083                return webbuild.dojoContents;