Changeset 41
- Timestamp:
- 06/06/08 10:02:33 (6 months ago)
- Files:
-
- trunk/lily/lily/chrome/content/externals/patcher.js (modified) (3 diffs)
- trunk/lily/lily/chrome/content/object.js (modified) (1 diff)
- trunk/lily/lily/chrome/content/patch.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lily/lily/chrome/content/externals/patcher.js
r40 r41 51 51 if(!isPatchString && /##\w+##/.test(param)) { 52 52 this.displayName = param.match(/##(\w+)##/)[1]; 53 this.displayArgs = false;53 this.displayArgs = (this.patchArgs)?this.patchArgs.replace(/##\w+##/,""):false; 54 54 } 55 55 … … 73 73 74 74 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+##/,""))); 77 77 o.controller.cleanupOutletConnections(); 78 78 Lily.patcherReloadFlag=false; //reload over … … 274 274 },100); 275 275 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 281 284 } 282 285 trunk/lily/lily/chrome/content/object.js
r38 r41 1755 1755 this.inputWrapper=this.getElByID(this.parent.createElID("inputWrapper")); 1756 1756 1757 if(t his.parent.displayArgs) //display args ok...1757 if(typeof this.parent.displayArgs == "boolean" && this.parent.displayArgs) //display args ok... 1758 1758 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 1761 1763 1762 1764 } trunk/lily/lily/chrome/content/patch.js
r40 r41 416 416 o.init(); //generic- user defined 417 417 } 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+"##")); 419 419 } 420 420 … … 432 432 var id=oldObj.objID; 433 433 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; 439 437 440 438 //if we're just modifying the args, grab the old connections … … 446 444 447 445 //create new object 448 var o=this.createObject(n ame,null,y,x,newID,args);449 446 var o=this.createObject(newObjName,null,y,x,newID,args); 447 450 448 //if we're recreating the same extern 451 449 if(newID) { … … 504 502 //restore previously saved connections 505 503 this.restoreConnections=function(connections) { 504 log(connections) 506 505 for(var i=0;i<connections.length;i++) { 507 506 this.createConnection(connections[i].inlet,connections[i].outlet,connections[i].segmentArray,null) … … 1678 1677 var patchArr = thisPtr.patch.patchModel.subPatchArray; 1679 1678 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; 1683 1680 try { 1681 var evt = p.document.createEvent("Event"); 1682 evt.initEvent(e, true, false); 1684 1683 p.document.dispatchEvent(evt); 1685 1684 } catch(e) {}
