Changeset 64
- Timestamp:
- 07/21/08 15:04:16 (1 month ago)
- Files:
-
- trunk/lily/lily/chrome/content/externals.js (modified) (3 diffs)
- trunk/lily/lily/chrome/content/lily.js (modified) (2 diffs)
- trunk/lily/lily/chrome/content/model.js (modified) (1 diff)
- trunk/lily/lily/chrome/content/patch-properties.html (modified) (2 diffs)
- trunk/lily/lily/chrome/content/patch-properties.xul (modified) (1 diff)
- trunk/lily/lily/chrome/content/patch.js (modified) (3 diffs)
- trunk/lily/lily/chrome/content/utils.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lily/lily/chrome/content/externals.js
r63 r64 79 79 } else { 80 80 LilyDebugWindow.error("Couldn't load the patch or external "+stripped+". An object with that name is already exists."); 81 } 81 } 82 82 }, 83 83 … … 142 142 this.objArray[i].displayName=LilyUtils.getObjectMetaData(objName).htmlName; 143 143 this.objArray[i].menuName=LilyUtils.getObjectMetaData(objName).textName; 144 this.objArray[i].catName= LilyUtils.getObjectMetaData(objName).objectCategory;144 this.objArray[i].catName=(LilyUtils.getObjectMetaData(objName).objectCategory?LilyUtils.getObjectMetaData(objName).objectCategory:LilyUtils.extractPatchCat(this.objArray[i].sourceCode)) 145 145 this.objArray[i].objSummary=(LilyUtils.getObjectMetaData(objName).objectSummary?LilyUtils.getObjectMetaData(objName).objectSummary:LilyUtils.extractPatchDesc(this.objArray[i].sourceCode)); 146 146 this.objArray[i].objArguments=LilyUtils.getObjectMetaData(objName).objectArguments; … … 338 338 var tmp=[]; 339 339 for(var i=0;i<this.objArray.length;i++) { 340 if((this.objArray[i]. name.indexOf(".json")==-1)&&(this.objArray[i].catName!=undefined))340 if((this.objArray[i].catName)) 341 341 tmp.push(this.objArray[i]); 342 342 } trunk/lily/lily/chrome/content/lily.js
r59 r64 1192 1192 var initVals = { 1193 1193 title: p.title||"Untitled", 1194 c olor: p.color||"#FFFFFF",1194 category: p.category||"", 1195 1195 height: p.heightInSubPatch||"0", 1196 1196 width: p.widthInSubPatch||"0", … … 1198 1198 }; 1199 1199 1200 win.openDialog("chrome://lily/content/patch-properties.xul", "cWin","width=450,height=4 05,left=50,top=550,close=no,scrollbars=no,dialog=yes,resizable=no,toolbar=no,menubar=no,location=no,status=no,chrome=yes,alwaysRaised=yes",function(val){1200 win.openDialog("chrome://lily/content/patch-properties.xul", "cWin","width=450,height=450,left=50,top=250,close=no,scrollbars=no,dialog=yes,resizable=no,toolbar=no,menubar=no,location=no,status=no,chrome=yes,alwaysRaised=yes",function(val){ 1201 1201 for(var x in val) { 1202 1202 switch(x) { 1203 1203 case "title": 1204 1204 p.patchView.setPatchTitle(val[x]); 1205 case "c olor":1206 p. patchView.setPatchColor(val[x]);1205 case "category": 1206 p.category=LilyUtils.escape(val[x]); 1207 1207 case "height": 1208 1208 p.heightInSubPatch=val[x]; trunk/lily/lily/chrome/content/model.js
r60 r64 104 104 j+="'color':"+quote+this.patch.color+quote+comma; 105 105 j+="'mode':"+quote+this.patch.patchController.editable+quote+comma; 106 j+="'description':"+quote+this.patch.description+quote+comma; 106 j+="'description':"+quote+this.patch.description+quote+comma; 107 j+="'category':"+quote+this.patch.category+quote+comma; 107 108 j+="'heightInSubPatch':"+quote+this.patch.heightInSubPatch+quote+comma; 108 109 j+="'widthInSubPatch':"+quote+this.patch.widthInSubPatch+quote+comma; trunk/lily/lily/chrome/content/patch-properties.html
r58 r64 1 1 <html> 2 <head> 3 <script> 4 function toggleInputs(checked) { 5 document.getElementById("height").disabled=!checked; 6 document.getElementById("width").disabled=!checked; 7 } 8 </script> 9 </head> 2 10 3 11 <body> … … 7 15 <td align="right" style="background:lightgrey" width="145">Title:</td> 8 16 <td><input onchange="parentWin.saveDialog();" size="30" style="font-size:14px;font-family:verdana,DejaVu Sans,sans-serif;" id="title" type="text"></td> 9 </tr> 17 </tr> 10 18 <tr> 11 <td align="right" style="background:lightgrey"> Color:</td>12 <td><input onc hange="parentWin.saveDialog();" size="30" style="font-size: 14px; font-family:verdana,DejaVu Sans,sans-serif;" id="color" type="text"></td>19 <td align="right" style="background:lightgrey">Open in SubPatch:</td> 20 <td><input onclick="toggleInputs(this.checked);" type="checkbox" id="open_in_subpatch"></td> 13 21 </tr> 14 22 <tr> 15 23 <td align="right" style="background:lightgrey">Height in Subpatch:</td> 16 <td><input onchange="parentWin.saveDialog();" size="30" style="font-size: 14px; font-family:verdana,DejaVu Sans,sans-serif;" id="height" type="text"></td>24 <td><input disabled="disabled" onchange="parentWin.saveDialog();" size="30" style="font-size: 14px; font-family:verdana,DejaVu Sans,sans-serif;" id="height" type="text"></td> 17 25 </tr> 18 26 <tr> 19 27 <td align="right" style="background:lightgrey">Width in Subpatch:</td> 20 <td><input onchange="parentWin.saveDialog();" size="30" style="font-size: 14px; font-family:verdana,DejaVu Sans,sans-serif;" id="width" type="text"></td>28 <td><input disabled="disabled" onchange="parentWin.saveDialog();" size="30" style="font-size: 14px; font-family:verdana,DejaVu Sans,sans-serif;" id="width" type="text"></td> 21 29 </tr> 30 <tr> 31 <td align="right" style="background:lightgrey">Category:</td> 32 <td><input onchange="parentWin.saveDialog();" size="30" style="font-size: 14px; font-family:verdana,DejaVu Sans,sans-serif;" id="category" type="text"></td> 33 </tr> 22 34 <tr> 23 35 <td align="right" style="background:lightgrey">Description:</td> 24 36 <td><textarea onchange="parentWin.saveDialog();" style="font-size: 14px; font-family:verdana,DejaVu Sans,sans-serif;" cols="29" rows="4" id="desc"></textarea></td> 25 </tr> 37 </tr> 26 38 <tr> 27 39 <td colspan="2" align="center" style="background:lightgrey"> trunk/lily/lily/chrome/content/patch-properties.xul
r58 r64 47 47 48 48 for(var x in tmp) { 49 if(doc.getElementById(x) ) {49 if(doc.getElementById(x) && !doc.getElementById(x).disabled) { 50 50 tmp[x] = doc.getElementById(x).value; 51 51 } trunk/lily/lily/chrome/content/patch.js
r61 r64 36 36 this.widthInSubPatch=0; //width when loaded in a subpatch 37 37 this.description=""; //patch description. 38 this.category=""; //patch category. 38 39 this.color="#FFFFFF" //background color 39 this.desc=""; //patch description40 40 this.fontSize=LilyUtils.getDefaultFont()[1]; //font size in px 41 41 this.fontFamily=LilyUtils.getDefaultFont()[0]; //font face … … 738 738 739 739 if(typeof patch.title!="undefined" && !subPatchID && !opID && this.patchWindowType=="popup") 740 this.patchView.setPatchTitle(patch Name); //update the patch title - patch.title740 this.patchView.setPatchTitle(patch.title||patchName); //update the patch title - patch.title 741 741 742 742 if(typeof patch.color!="undefined" && !subPatchID && !opID) … … 745 745 if(typeof patch.description!="undefined" && !subPatchID && !opID) 746 746 this.description=patch.description; //update color 747 748 if(typeof patch.category!="undefined" && !subPatchID && !opID) 749 this.category=patch.category; //update color 747 750 748 751 if(typeof patch.heightInSubPatch!="undefined" && !subPatchID && !opID) trunk/lily/lily/chrome/content/utils.js
r63 r64 1432 1432 */ 1433 1433 extractPatchDesc: function(data) { 1434 var desc=data.match(/'description':'([\S|\s]+)',' heightInSubPatch'/);1434 var desc=data.match(/'description':'([\S|\s]+)','category'/); 1435 1435 1436 1436 if(desc && desc.length>1) 1437 1437 return desc[1]; 1438 else 1439 return ""; 1440 }, 1441 1442 /* 1443 Method: extractPatchCat 1444 get the patch size without having to eval the patch JSON. 1445 1446 Arguments: 1447 data - JSON patch string. 1448 1449 Returns: 1450 Patch description. 1451 */ 1452 1453 //'description':'','category':'','heightInSubPatch': 1454 1455 extractPatchCat: function(data) { 1456 var cat=data.match(/'category':'([\S|\s]+)','heightInSubPatch'/); 1457 1458 if(cat && cat.length>1) 1459 return cat[1]; 1438 1460 else 1439 1461 return "";
