This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os, platform, sys, cgi, cgitb | |
cgitb.enable() # Make debug info available | |
def printBreak(msg): | |
print "</pre>\n" + msg + "\n<pre>" | |
def printEnv(var): | |
print var[0] | |
print " " + var[1] + ": " + os.getenv(var[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Documentation for <a href="http://learn.jquery.com/code-organization/deferreds/">jQuery Deferred</a> objects. | |
<p> | |
<div> | |
<button id="concur">Concurrent</button> | |
<button id="sequent">Sequential</button> | |
</div> | |
<p> | |
<div id="result"> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Sample code for parsing SVG style coordinates. | |
// | |
/* Assumes HTML: | |
<div id="content" > | |
<canvas id="drawing"> | |
</canvas> | |
</div> | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const kfontNameStr = app.stringIDToTypeID("fontName"); | |
const kfontPostScriptNameStr = app.stringIDToTypeID("fontPostScriptName"); | |
const kfontStyleNameStr = app.stringIDToTypeID("fontStyleName"); | |
const kfromStr = app.stringIDToTypeID("from"); | |
const khorizontalStr = app.stringIDToTypeID("horizontal"); | |
const kmakeStr = app.stringIDToTypeID("make"); | |
const kmodalToolChangeKindPaint = app.stringIDToTypeID("paint"); | |
const knullStr = app.stringIDToTypeID("null"); | |
const kpercentUnitStr = app.stringIDToTypeID("percentUnit"); | |
const kpointsUnitStr = app.stringIDToTypeID("pointsUnit"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Code sample for creating a rectangular vector mask | |
// around the target paint layer. J. Peterson | |
// | |
function getLayerBounds() | |
{ | |
var p = new Promise(function(resolve, reject) | |
{ | |
_spaces.ps.descriptor.get({_ref:[{"_ref":"property","_property":"bounds"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Code sample for creating a rectangular vector mask | |
// around the target paint layer. J. Peterson | |
// | |
function getLayerBounds() | |
{ | |
var p = new Promise(function(resolve, reject) | |
{ | |
_spaces.ps.descriptor.get({_ref:[{"_ref":"property","_property":"bounds"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Sample code to enable/disable Generator from DesignSpace JavaScript | |
// J. Peterson aug-'15 | |
// | |
// Reference to the generator keys | |
function appRef(key) | |
{ // either generatorStatus or pluginPicker | |
return {"_ref":[{"_ref":"property","_property":key}, | |
{"_ref":"application","_enum":"ordinal", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Sample code to retrieve the bounds of the layer's vector mask, and | |
// also get the unclipped bounds of the mask by temporarily disabling the | |
// vector mask. | |
// | |
// Get attribute from the active layer. | |
// Records the requested result in "state". | |
function promiseLayerGet(resultKey, state) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Take a shape specified by clipShapeID, and use it to | |
// create a vectorMask for layer clippedLayerID. | |
// Shape layer is deleted. | |
function createMaskFromShape(clipShapeID, clippedLayerID) | |
{ | |
var clipShapeDesc = {"null":{"_ref":[{"_ref":"layer","_id":clipShapeID}]}}; | |
var clippedLayerDesc = {"null":{"_ref":[{"_ref":"layer","_id":clippedLayerID}]}}; | |
var vecMaskRef = {"_ref":"path","_enum":"path","_value":"vectorMask"}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Copy the vector mask from a shape to another layer. | |
// This takes layer names, modify as indicated below to take | |
// layer ID's instead. | |
// The shape is not deleted or modified. | |
function createMaskFromShape(srcShapeName, layerToClip) | |
{ | |
srcLayerRef = {"_ref":"layer","_name":srcShapeName}; // Replace "_name" with "_id" | |
dstLayerRef = {"_ref":"layer","_name":layerToClip}; // to use layer ID's instead. |
OlderNewer