Changeset 75

Show
Ignore:
Timestamp:
07/24/08 14:15:07 (4 weeks ago)
Author:
bi..@lilyapp.org
Message:

fix bug #74.

Files:

Legend:

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

    r67 r75  
    208208                         
    209209                        //open the patch 
    210                         thisPatch.obj.patchWindowType="iframe";         
     210                        thisPatch.obj.patchWindowType="iframe"; 
    211211                         
    212212                        //override this function to point at this patch (not the subpatch) 
     
    297297                openPatchWin=Lily.openPatchFromFile(thisPatch.file,false,false); 
    298298                 
     299                if(!thisPtr.fPath) openPatchWin.obj.usesTmpFile=true;    
     300                 
     301                //override this function to point at this patch (not the subpatch) 
     302                openPatchWin.obj.getContainerPatch=function() { 
     303                        return thisPtr.parent; //pointer to the container patch 
     304                } 
     305                                 
    299306                //timing isn't critical here so we'll use setimteout to avoid the hassle of setting a listener on the inner browser window 
    300307                setTimeout(function(){ 
  • trunk/lily/lily/chrome/content/patch.js

    r66 r75  
    4444        this.hidden=hide||false; // 
    4545        this.zoomLevel=1; 
     46        this.usesTmpFile=false; //i.e. a temporary patch for editing a patcher. 
    4647         
    4748        var thisPtr=this; 
     
    135136                return parent; 
    136137        } 
     138         
     139        /* 
     140                Method: getFirstParentPatch 
     141                starting from the current patch, walks up  
     142                the patch tree and returns the first non  
     143                temporary/editor patch it finds. 
     144                 
     145                Returns:  
     146                        returns a patch object. 
     147        */               
     148        this.getFirstParentPatch=function() { 
     149                 
     150                if(this.usesTmpFile) { 
     151                        var parent=this.getContainerPatch(); 
     152                        while(parent.usesTmpFile) { 
     153                                parent=parent.getContainerPatch(); 
     154                        } 
     155                } else { 
     156                        var parent = this; 
     157                } 
     158 
     159                return parent; 
     160        }        
    137161         
    138162        /* 
  • trunk/lily/lily/chrome/content/utils.js

    r74 r75  
    938938        /* 
    939939                Method: getFilePath 
    940                         returns the path to a file if the supplied path is correct or its in  
    941                         the parent patch directory or if it is in  the search patch. 
     940                        returns the path to a file if the supplied path is correct or if the file is in  
     941                        the parent patch directory or the search patch. 
    942942         
    943943                Arguments:  
     
    967967                        } catch(e) { 
    968968                                //didn't work so try it as an relative path 
    969                                 if(Lily.getCurrentPatch()) {                            
    970                                         var parentDir=Lily.getCurrentPatch().getPatchDir(); //get the parent dir        
     969                                if(Lily.getCurrentPatch()) {                     
     970                                        var parentDir=Lily.getCurrentPatch().getFirstParentPatch().getPatchDir(); //get the parent dir 
    971971                                        if(parentDir) { //got it 
    972972                                                try {