Changeset 89

Show
Ignore:
Timestamp:
08/17/08 14:24:50 (4 months ago)
Author:
bi..@lilyapp.org
Message:

fix exporter after tree changes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lily/lily/chrome/content/exporter.js

    r72 r89  
    512512                tmp.copyTo(contentOut,null); 
    513513 
    514                 //utils.js 
    515                 var tmpIn = contentIn.clone(); 
    516                 tmpIn.append("utils.js"); 
    517                 var tmpOut = contentOut.clone(); 
    518                 tmpOut.append("utils.js"); 
    519                 var data = LilyUtils.readFile(tmpIn); 
    520                 data = data.replace(/chrome:\/\/lily/g,("chrome://"+projectName));               
    521                 LilyUtils.writeFile(tmpOut,data); 
     514                //utils 
     515                var utils_files = [ 
     516                        "core.js", 
     517                        "file.js", 
     518                        "font.js", 
     519                        "patch.js", 
     520                        "prefs.js", 
     521                        "string.js", 
     522                        "window.js" 
     523                ] 
     524 
     525                var utilsOut = contentOut.clone(); 
     526                utilsOut.append("utils"); 
     527 
     528                if( !utilsOut.exists() || !utilsOut.isDirectory() ) {   // if it doesn't exist, create 
     529                   utilsOut.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0777); 
     530                } 
     531 
     532                for(var i=0;i<utils_files.length;i++) { 
     533                        var tmpIn = contentIn.clone(); 
     534                        tmpIn.append("utils"); 
     535                        tmpIn.append(utils_files[i]);                    
     536 
     537                        var tmpOut = contentOut.clone(); 
     538                        tmpOut.append("utils"); 
     539                        tmpOut.append(utils_files[i]);   
     540 
     541                        var data = LilyUtils.readFile(tmpIn); 
     542                        data = data.replace(/chrome:\/\/lily/g,("chrome://"+projectName));               
     543                        LilyUtils.writeFile(tmpOut,data); 
     544                } 
     545                 
     546                //components 
     547                var utils_files = [ 
     548                        "dialog.js", 
     549                        "editor.js", 
     550                        "iframe.js", 
     551                        "xhr.js" 
     552                ] 
     553 
     554                var componentsOut = contentOut.clone(); 
     555                componentsOut.append("components"); 
     556 
     557                if( !componentsOut.exists() || !componentsOut.isDirectory() ) {   // if it doesn't exist, create 
     558                   componentsOut.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0777); 
     559                } 
     560 
     561                for(var i=0;i<utils_files.length;i++) { 
     562                        var tmpIn = contentIn.clone(); 
     563                        tmpIn.append("components"); 
     564                        tmpIn.append(utils_files[i]);                    
     565 
     566                        var tmpOut = contentOut.clone(); 
     567                        tmpOut.append("components"); 
     568                        tmpOut.append(utils_files[i]);   
     569 
     570                        var data = LilyUtils.readFile(tmpIn); 
     571                        data = data.replace(/chrome:\/\/lily/g,("chrome://"+projectName));               
     572                        LilyUtils.writeFile(tmpOut,data); 
     573                }                
    522574                 
    523575                //bootstrap.js 
     
    863915                                tmp.append("services.js"); 
    864916                                tmp.copyTo(contentOut,null); 
    865                                  
    866                                 //utils.js 
    867                                 var tmpIn = contentIn.clone(); 
    868                                 tmpIn.append("utils.js"); 
    869                                 var tmpOut = contentOut.clone(); 
    870                                 tmpOut.append("utils.js");                               
    871                                 LilyUtils.writeFile(tmpOut,LilyUtils.readFile(tmpIn).replace(/chrome:\/\/lily/g,("chrome://"+projectName))); 
     917                                                                 
     918                                //utils 
     919                                var utils_files = [ 
     920                                        "core.js", 
     921                                        "file.js", 
     922                                        "font.js", 
     923                                        "patch.js", 
     924                                        "prefs.js", 
     925                                        "string.js", 
     926                                        "window.js" 
     927                                ] 
     928 
     929                                var utilsOut = contentOut.clone(); 
     930                                utilsOut.append("utils"); 
     931 
     932                                if( !utilsOut.exists() || !utilsOut.isDirectory() ) {   // if it doesn't exist, create 
     933                                   utilsOut.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0777); 
     934                                } 
     935 
     936                                for(var i=0;i<utils_files.length;i++) { 
     937                                        var tmpIn = contentIn.clone(); 
     938                                        tmpIn.append("utils"); 
     939                                        tmpIn.append(utils_files[i]);                    
     940 
     941                                        var tmpOut = contentOut.clone(); 
     942                                        tmpOut.append("utils"); 
     943                                        tmpOut.append(utils_files[i]);   
     944 
     945                                        var data = LilyUtils.readFile(tmpIn); 
     946                                        data = data.replace(/chrome:\/\/lily/g,("chrome://"+projectName));               
     947                                        LilyUtils.writeFile(tmpOut,data); 
     948                                } 
     949 
     950                                //components 
     951                                var utils_files = [ 
     952                                        "dialog.js", 
     953                                        "editor.js", 
     954                                        "iframe.js", 
     955                                        "xhr.js" 
     956                                ] 
     957 
     958                                var componentsOut = contentOut.clone(); 
     959                                componentsOut.append("components"); 
     960 
     961                                if( !componentsOut.exists() || !componentsOut.isDirectory() ) {   // if it doesn't exist, create 
     962                                   componentsOut.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0777); 
     963                                } 
     964 
     965                                for(var i=0;i<utils_files.length;i++) { 
     966                                        var tmpIn = contentIn.clone(); 
     967                                        tmpIn.append("components"); 
     968                                        tmpIn.append(utils_files[i]);                    
     969 
     970                                        var tmpOut = contentOut.clone(); 
     971                                        tmpOut.append("components"); 
     972                                        tmpOut.append(utils_files[i]);   
     973 
     974                                        var data = LilyUtils.readFile(tmpIn); 
     975                                        data = data.replace(/chrome:\/\/lily/g,("chrome://"+projectName));               
     976                                        LilyUtils.writeFile(tmpOut,data); 
     977                                }                                                                
    872978                                 
    873979                                //bootstrap.js