Changeset 75
- Timestamp:
- 07/24/08 14:15:07 (4 weeks ago)
- Files:
-
- trunk/lily/lily/chrome/content/externals/patcher.js (modified) (2 diffs)
- trunk/lily/lily/chrome/content/patch.js (modified) (2 diffs)
- trunk/lily/lily/chrome/content/utils.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lily/lily/chrome/content/externals/patcher.js
r67 r75 208 208 209 209 //open the patch 210 thisPatch.obj.patchWindowType="iframe"; 210 thisPatch.obj.patchWindowType="iframe"; 211 211 212 212 //override this function to point at this patch (not the subpatch) … … 297 297 openPatchWin=Lily.openPatchFromFile(thisPatch.file,false,false); 298 298 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 299 306 //timing isn't critical here so we'll use setimteout to avoid the hassle of setting a listener on the inner browser window 300 307 setTimeout(function(){ trunk/lily/lily/chrome/content/patch.js
r66 r75 44 44 this.hidden=hide||false; // 45 45 this.zoomLevel=1; 46 this.usesTmpFile=false; //i.e. a temporary patch for editing a patcher. 46 47 47 48 var thisPtr=this; … … 135 136 return parent; 136 137 } 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 } 137 161 138 162 /* trunk/lily/lily/chrome/content/utils.js
r74 r75 938 938 /* 939 939 Method: getFilePath 940 returns the path to a file if the supplied path is correct or i ts in941 the parent patch directory or if it is inthe 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. 942 942 943 943 Arguments: … … 967 967 } catch(e) { 968 968 //didn't work so try it as an relative path 969 if(Lily.getCurrentPatch()) { 970 var parentDir=Lily.getCurrentPatch().get PatchDir(); //get the parent dir969 if(Lily.getCurrentPatch()) { 970 var parentDir=Lily.getCurrentPatch().getFirstParentPatch().getPatchDir(); //get the parent dir 971 971 if(parentDir) { //got it 972 972 try {
