Strict Standards: Only variables should be passed by reference in /home/abeall/public_html/fireworks/download.php on line 28

Warning: Cannot modify header information - headers already sent by (output started at /home/abeall/public_html/fireworks/download.php:28) in /home/abeall/public_html/fireworks/download.php on line 44
// Fireworks JavaScript Command // Copy to Fireworks/Configuration/Commands/ // Aaron Beall 2011 - http://abeall.com // Version 1.2 var dom = fw.getDocumentDOM(); // document object var sel = new Array().concat(fw.selection); // saved selection /* TODO - [DONE-v1.2] preserve pathAttributes - allow multiple fetchable hold states */ function FetchPaths() { if (!sel.length) return false; var origPaths = []; for (s in sel) if (sel[s] == '[object Path]' ) origPaths.push(sel[s]); if (!origPaths.length) return false; fw.selection = origPaths; var fetchablePath = false; var i = origPaths.length; while(i--){ if(origPaths[i].customData.holdPath_contours){ fetchablePath = true; break; } } if(!fetchablePath){ alert('To restore a path, you must first perform save path state. You can then perform restore path later on that path to revert it to it\'s condition when you performed the save.'); return false; } for(var i = 0; i < origPaths.length; i++){ var path = origPaths[i]; var left = path.left, top = path.top; var heldContours = path.customData.holdPath_contours; if(!heldContours) continue; path.contours.length = heldContours.length; for(var c = 0; c < heldContours.length; c++){ path.contours[c] = new Contour(); path.contours[c].isClosed = heldContours[c].isClosed; for(var n = 0; n < heldContours[c].nodes.length; n++){ path.contours[c].nodes[n] = new ContourNode(); pasteNode(path.contours[c].nodes[n], heldContours[c].nodes[n]); } } var heldPathAttrs = path.customData.holdPath_pathAttrs; if(heldPathAttrs && fw.yesNoDialog("Restore path fill and stroke?")){ fw.selection = [path]; if(heldPathAttrs.fill){ dom.setFillNColor(heldPathAttrs.fill, heldPathAttrs.fillColor); //dom.moveFillVectorHandleBy({x:heldPathAttrs.fillHandle1.x - path.pathAttributes.fillHandle1.x, y:heldPathAttrs.fillHandle1.y - path.pathAttributes.fillHandle1.y}, "start", false, true); //dom.moveFillVectorHandleBy({x:heldPathAttrs.fillHandle2.x - path.pathAttributes.fillHandle2.x, y:heldPathAttrs.fillHandle2.y - path.pathAttributes.fillHandle2.y}, "end1", false, true); //dom.moveFillVectorHandleBy({x:heldPathAttrs.fillHandle3.x - path.pathAttributes.fillHandle3.x, y:heldPathAttrs.fillHandle3.y - path.pathAttributes.fillHandle3.y}, "end2", false, true); }else if(path.pathAttributes.fill) dom.setFill(null); if(heldPathAttrs.brush){ dom.setBrushNColor(heldPathAttrs.brush, heldPathAttrs.brushColor); }else if(path.pathAttributes.brush) dom.setBrush(null); } path.left = left; path.top = top; } fw.selection = sel; return true; } FetchPaths(); // paste node function pasteNode(pt, ptCopy){ copyProps(pt, ptCopy, ["x", "y", "succX", "succY", "predX", "predY", "randomSeed", "isSelectedPoint", "isCurvePoint", "name"]); var dynamicInfo = []; for(var i = 0; i < ptCopy.dynamicInfo.length; i++) dynamicInfo.push(copyProps(new ContourNodeDynamicInfo(), ptCopy.dynamicInfo[i], ["pressure", "duration", "velocity"])); pt.dynamicInfo = dynamicInfo; return pt; } // copy props by name function copyProps(targetObj, sourceObj, props){ var p = props.length; while(p--) targetObj[props[p]] = sourceObj[props[p]]; return targetObj; }