Changeset 40

Show
Ignore:
Timestamp:
06/05/08 16:30:16 (6 months ago)
Author:
bi..@lilyapp.org
Message:

fix ticket #22. cool!

Files:

Legend:

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

    r14 r40  
    127127        error:function(msg) {            
    128128                if(this.dWin) { 
    129                         setTimeout(function(){LilyDebugWindow.dispatch(("• "+msg),"bold",null,null,null,"red")},1);  
     129                        setTimeout(function(){LilyDebugWindow.dispatch((msg),"bold",null,null,null,"red")},1);         
    130130                } 
    131131        }, 
  • trunk/lily/lily/chrome/content/externals.js

    r14 r40  
    139139                                        this.objDisplay[((this.objArray[i].menuName)?this.objArray[i].menuName:"tmp")]=objName; 
    140140                                        this.objDisplay[objName]=objName; 
    141                                         this.objLeaf[this.objArray[i].name]=this.objArray[i].name;      
     141                                        this.objLeaf[this.objArray[i].name]=this.objArray[i].name; 
    142142                                } catch(e) { 
    143143                                        LilyDebugWindow.error("External object "+extName.toUpperCase()+" couldn't be loaded: "+e.name + ": " + e.message+" "+e.fileName+",  line: "+e.lineNumber) 
     
    256256                 
    257257                source = LilyUtils.readFileFromPath(path,false).data;            
    258                 LilyUtils.loadScript("file://"+path,Lily); 
     258                if(!LilyUtils.isPatchString()) LilyUtils.loadScript("file://"+path,Lily); //only load externs, not patches 
    259259                 
    260260                return source; //return the source       
     
    293293        */ 
    294294        isLoadable: function(str) {                                                      
    295                 return str.match(/\.js$|\.zip$|\.rsrc$/); 
     295                return str.match(/\.js$|\.zip$|\.rsrc$|.json$/); 
    296296        },       
    297297 
     
    317317                var tmp=[]; 
    318318                for(var i=0;i<this.objArray.length;i++) {                        
    319                         if(this.objArray[i].name.indexOf(".json")==-1) 
    320                                 tmp.push(this.objArray[i]); 
     319                        tmp.push(this.objArray[i]); 
    321320                } 
    322321                tmp.sort(function(a,b) { 
  • trunk/lily/lily/chrome/content/externals/patcher.js

    r24 r40  
    4141 
    4242        //flag to determine if we've got a patch string or file path 
    43         var isPatchString=(/var patch={/.test(param)||!param.length);   
    44          
     43        var isPatchString=(/var patch={/.test(param)||!param.length); 
     44                        
    4545        var pArr = (!isPatchString)?LilyUtils.splitArgs(param):[]; 
    4646        this.fPath = (!isPatchString)?pArr.shift():""; //pull off the path 
     
    4848        this.displayArgs=(isPatchString)?false:true; //don't display argument if it isn't a patch path 
    4949        this.patchArgs=(!isPatchString)?pArr.join(" "):""; //rest of args as a string 
     50         
     51        if(!isPatchString && /##\w+##/.test(param)) { 
     52                this.displayName = param.match(/##(\w+)##/)[1]; 
     53                this.displayArgs = false; 
     54        } 
    5055         
    5156        //inlet/outlet arrays 
  • trunk/lily/lily/chrome/content/patch.js

    r35 r40  
    376376                var obj=(this.getModule(name))?this.getModule(name):this.getModule("tmp"); 
    377377                var count=this.patchModel.getObjectCount()+1; //get the patch object count 
    378                                  
    379                 if(obj) { 
     378                                                
     379                if(obj && typeof obj == "function") { 
    380380                        //prototype the base to the class we're creating & then create it. 
    381381                        obj.prototype=new LilyObjectBase(className,this,subPatchID,top,left,objID,argStr); 
     
    415415                         
    416416                        o.init(); //generic- user defined 
     417                } else if(obj && typeof obj == "string") { 
     418                        this.createObject("patcher",pID,t,l,id,(obj+" ##"+className+"##")); 
    417419                } 
    418420                 
     
    10481050                                 
    10491051                if(typeof Lily["$"+LilyObjectList.objDisplay[className]] != "undefined") { 
    1050                         return Lily["$"+LilyObjectList.objDisplay[className]]; 
     1052                        return Lily["$"+LilyObjectList.objDisplay[className]]; //external 
     1053                } else if(LilyObjectList.search(className)) { 
     1054                        return LilyObjectList.search(className).path; //if its a patch, just return the path 
    10511055                } else { 
    10521056                        //if the object isn't found- look in the patch directory/subdirectories. 
    10531057                        var dir = this.getPatchDir(); 
    1054                         if(!LilyObjectList.isLoaded(className) && dir) { //this loads the object if found 
     1058                        if(!LilyObjectList.isLoaded(className) && dir) { //this loads the extern if found 
    10551059                                if(!LilyObjectList.searchDirectory(dir,className+".js")) { 
    1056                                         LilyDebugWindow.error("Couldn't find external "+oArray[x].name+"."); 
    1057                                         return null; 
     1060                                        if(!LilyObjectList.searchDirectory(dir,className+".json")) { //this loads the patch if found 
     1061                                                LilyDebugWindow.error("Couldn't find external "+oArray[x].name+"."); 
     1062                                                return null; 
     1063                                        } else { 
     1064                                                return LilyObjectList.search(className).path; //if its a patch, just return the path 
     1065                                        } 
    10581066                                } else { 
    10591067                                        return Lily["$"+LilyObjectList.objDisplay[className]]; 
  • trunk/lily/lily/chrome/content/utils.js

    r32 r40  
    6666        */ 
    6767        getObjectMetaData: function(objName) { 
    68                 return Lily["$"+objName+"MetaData"];             
     68                if(typeof Lily["$"+objName+"MetaData"] != "undefined") { 
     69                        return Lily["$"+objName+"MetaData"];                     
     70                } else { //if its not defined then return some barebones value 
     71                        return { 
     72                                textName:objName, 
     73                                htmlName:objName, 
     74                                objectCategory:"", 
     75                                objectSummary:"", 
     76                                objectArguments:"" 
     77                        } 
     78                }        
    6979        }, 
    7080