Changeset 41

Show
Ignore:
Timestamp:
06/06/08 10:02:33 (6 months ago)
Author:
bi..@lilyapp.org
Message:

some fixes/enchacements for the previous checkin (40). more fixes coming...

Files:

Legend:

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

    r40 r41  
    5151        if(!isPatchString && /##\w+##/.test(param)) { 
    5252                this.displayName = param.match(/##(\w+)##/)[1]; 
    53                 this.displayArgs = false; 
     53                this.displayArgs = (this.patchArgs)?this.patchArgs.replace(/##\w+##/,""):false; 
    5454        } 
    5555         
     
    7373                                 
    7474                setTimeout(function(){ 
    75                         Lily.patcherReloadFlag=true; //start reload                             
    76                         var o = thisPtr.parent.replaceObject(thisPtr,"patcher",thisPtr.args); 
     75                        Lily.patcherReloadFlag=true; //start reload                      
     76                        var o = thisPtr.parent.replaceObject(thisPtr,thisPtr.displayName,((isPatchString)?thisPtr.args:thisPtr.patchArgs.replace(/##\w+##/,""))); 
    7777                        o.controller.cleanupOutletConnections();         
    7878                        Lily.patcherReloadFlag=false; //reload over 
     
    274274                },100); 
    275275                 
    276                 //watch the json property in the patch object- refresh the patcher when it updates. 
    277                 openPatchWin.watch("json",function(id,oldval,newval){ 
    278                         thisPtr.args=(isPatchString)?newval:thisPtr.fPath; //udpate the args with the json if its an embedded, otherwise use the filepath 
    279                         reloadPatch(); //recreate the patch with the new data. 
    280                 }) 
     276                setTimeout(function(){ 
     277                        //watch the json property in the patch object- refresh the patcher when it updates. 
     278                        openPatchWin.watch("json",function(id,oldval,newval){ 
     279                                thisPtr.args=(isPatchString)?newval:thisPtr.fPath; //udpate the args with the json if its an embedded, otherwise use the filepath 
     280                                reloadPatch(); //recreate the patch with the new data. 
     281                        });      
     282                },3000); 
     283 
    281284        } 
    282285         
  • trunk/lily/lily/chrome/content/object.js

    r38 r41  
    17551755                        this.inputWrapper=this.getElByID(this.parent.createElID("inputWrapper")); 
    17561756                         
    1757                         if(this.parent.displayArgs) //display args ok... 
     1757                        if(typeof this.parent.displayArgs == "boolean" && this.parent.displayArgs) //display args ok... 
    17581758                                this.inputWrapper.innerHTML=LilyUtils.string2HTML(this.cmdStr); //escape any args 
    1759                         else 
    1760                                 this.inputWrapper.innerHTML=this.display; //just the name since we're not displaying args                
     1759                        else if(typeof this.parent.displayArgs == "boolean" && !this.parent.displayArgs) 
     1760                                this.inputWrapper.innerHTML=this.display; //just the name since we're not displaying args 
     1761                        else if(typeof this.parent.displayArgs == "string" && this.parent.displayArgs) 
     1762                                this.inputWrapper.innerHTML=this.display+" "+this.parent.displayArgs; //display this specific args 
    17611763                         
    17621764                } 
  • trunk/lily/lily/chrome/content/patch.js

    r40 r41  
    416416                        o.init(); //generic- user defined 
    417417                } else if(obj && typeof obj == "string") { 
    418                         this.createObject("patcher",pID,t,l,id,(obj+" ##"+className+"##")); 
     418                        return this.createObject("patcher",pID,t,l,id,(obj+" "+argStr+" ##"+className+"##")); 
    419419                } 
    420420                 
     
    432432                var id=oldObj.objID; 
    433433                oldObj.controller.replacing=true;                
    434                 var args=newArgs; 
    435                 var name=newObjName; 
    436                 var displayName = LilyUtils.getObjectMetaData(oldObj.name).textName;             
    437                 var saveConnections=(displayName==name)?true:false; 
    438                 var newID=(displayName==newObjName)?id:null; 
     434                var args=newArgs;        
     435                var saveConnections=(oldObj.displayName==newObjName)?true:false; 
     436                var newID=(oldObj.displayName==newObjName)?id:null; 
    439437                 
    440438                //if we're just modifying the args, grab the old connections 
     
    446444                 
    447445                //create new object 
    448                 var o=this.createObject(name,null,y,x,newID,args); 
    449                  
     446                var o=this.createObject(newObjName,null,y,x,newID,args); 
     447                                
    450448                //if we're recreating the same extern 
    451449                if(newID) { 
     
    504502        //restore previously saved connections 
    505503        this.restoreConnections=function(connections) { 
     504                log(connections) 
    506505                for(var i=0;i<connections.length;i++) { 
    507506                        this.createConnection(connections[i].inlet,connections[i].outlet,connections[i].segmentArray,null) 
     
    16781677                var patchArr = thisPtr.patch.patchModel.subPatchArray; 
    16791678                for(var x  in patchArr) { 
    1680                         var p = patchArr[x].obj.patchView; 
    1681                         var evt = p.document.createEvent("Event");                       
    1682                         evt.initEvent(e, true, false); 
     1679                        var p = patchArr[x].obj.patchView;                       
    16831680                        try { 
     1681                                var evt = p.document.createEvent("Event");                       
     1682                                evt.initEvent(e, true, false);                           
    16841683                                p.document.dispatchEvent(evt);           
    16851684                        } catch(e) {}