Changeset 47

Show
Ignore:
Timestamp:
06/18/08 21:07:23 (6 months ago)
Author:
bi..@lilyapp.org
Message:

fix ticket #27
fix bug affecting multiple receives with the same name in multiple subpatch instances

Files:

Legend:

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

    r43 r47  
    5454                //if there any additional args, strip out the classname and assign them to display args. otherwise displayargs = false. 
    5555                this.displayArgs = (!/^##\w+##/.test(this.patchArgs))?this.patchArgs.replace(/##\w+##/,""):false; 
     56                this.loadsSubPatchByName = true; 
    5657        } 
    5758         
     
    6364        function replacePatchArgs(arg_str,data) { 
    6465                var patch_str = data; 
    65                 var tmp = LilyUtils.splitArgs(arg_str); 
     66                var tmp = LilyUtils.splitArgs(arg_str.replace(/##\w+##/,"")); 
    6667                for(var i=0;i<tmp.length;i++) { 
    6768                        var re = new RegExp("\\#"+(i+1),"g"); 
  • trunk/lily/lily/chrome/content/externals/receive.js

    r1 r47  
    5959                        var tmp = Lily.receiveObjects[thisPtr.receiveName]; 
    6060                        for(var i=0;i<tmp.length;i++) { 
    61                                 if(tmp[i].objID==thisPtr.objID) { 
     61                                if(tmp[i] === thisPtr) { 
    6262                                        tmp.splice(i,1); 
    6363                                        if(!tmp.length) { 
  • trunk/lily/lily/chrome/content/externals/subpatch.js

    r24 r47  
    243243        //clean up the subpatch 
    244244        this.destructor=function() { 
     245                thisPtr.parent.patchView.oWin.focus(); //restore focus so the iframe doesn't steal it. 
    245246                if(thisPatch.obj) { thisPatch.obj.close(); } 
    246247                thisPatch = {obj:null,id:pid,file:null,json:null}; //reset the thispatch object 
  • trunk/lily/lily/chrome/content/object.js

    r44 r47  
    3232*/ 
    3333function LilyObjectBase(name,parent,pID,top,left,id,args) 
    34 {                        
     34
     35        this.type="object"; //                   
    3536        this.parent=parent; //pointer to patch 
    3637        this.name=name; //classname 
     
    5960        this.resize=true; //should the object be resizable 
    6061        this.displayArgs=true; //should we see objects arguments (for non-UI objects only) 
    61         this.type="object"; 
     62        this.loadsSubPatchByName = false; //true when a subpatch is invoked by name 
    6263         
    6364        this.ui=null; //to filled in when view instantiates 
     
    415416                if((e.altKey && !LilyUtils.controlOrCommand(e)) && !thisPtr.controller.objDrag.pasted) { 
    416417                        if(thisPtr.name!="tmp") { 
    417                                 Lily.openHelpPatch(thisPtr.name); 
     418                                Lily.openHelpPatch((thisPtr.controller.objView.parent.loadsSubPatchByName)?thisPtr.controller.objView.parent.displayName:thisPtr.name); 
    418419                        } else if(thisPtr.controller.objInputControl.objInput && thisPtr.controller.objInputControl.objInput.value) { 
    419420                                var name = thisPtr.controller.objInputControl.objInput.value.split(" ")[0];