This file contains hidden or 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
try { | |
(function() | |
{ | |
if (fw.selection.length == 0) { | |
alert("To use this command, first select a group from which the Smart Resize auto shape should be detached."); | |
return; | |
} | |
var dom = fw.getDocumentDOM(); |
This file contains hidden or 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
// make a copy of the current selection by concatenating it | |
// with an empty array | |
var originalSelection = [].concat(fw.selection); | |
for (var i = 0, len = originalSelection.length; i < len; i++) { | |
// change the selection as needed | |
} | |
// restore the original copy of the selection | |
fw.selection = originalSelection; |
This file contains hidden or 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
/* | |
The regular expression below is used in John Resig's HTML parser written in JS, which | |
I was trying to use in an Adobe Fireworks extension to construct tables from HTML | |
source. In a browser, from IE6 on up, it produces: | |
[<table border="1">,table, border="1",""] | |
In Fireworks' JS parser, derived from Mozilla code released in *1998*, it produces: | |
null |
This file contains hidden or 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
function insertSymbol( | |
inSymbolName, | |
inPath) | |
{ | |
var dom = fw.getDocumentDOM(); | |
var middleX = Math.round(dom.width / 2); | |
var middleY = Math.round(dom.height / 2); | |
try { | |
// first assume the symbol is already in the library and try to |
This file contains hidden or 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
onButtonDown = function(event) | |
{ | |
event.result = [ | |
["save", "enabled", false], | |
["Pass", "enabled", false], | |
["save", "label", waitingFrase()] | |
]; | |
} | |
onButtonClick = function(event){ |
This file contains hidden or 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
/* | |
This code takes a 2D transformation matrix described as a one-dimensional array | |
(in column order, top to bottom and left to right) and decomposes it using the dojo | |
matrix library. This input matrix should produce a 45-deg X skew: | |
1 1 0 | |
0 1 0 | |
0 0 1 | |
The output of decompose() looks like this: |
This file contains hidden or 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
var dp = [], | |
files = []; | |
// concat the two directories into one array of paths. note that the object | |
// returned by enumFiles isn't a real array, so we can't call concat on it. | |
files = files.concat(Files.enumFiles(fw.appSmartShapesDir), | |
Files.enumFiles(fw.appSmartShapeToolsDir)); | |
for (var i = 0, len = files.length; i < len; i++) { | |
var file = files[i], |
This file contains hidden or 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
private const SupportedFWEvents:Object = { | |
onFwActiveDocumentChange: 1, | |
onFwActiveSelectionChange: 1, | |
onFwActiveToolChange: 1, | |
... | |
}; | |
private function onPreinitialize() : void | |
{ | |
// we need to register these callbacks early in the startup process. |
This file contains hidden or 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
// embed a local copy of the dojo JSON library, which has been changed | |
// to not depend on any other part of dojo. that way, we don't have to | |
// rely on external libraries. unlike Crockford's library, the dojo | |
// implementation doesn't change the prototypes of basic types, which | |
// caused problems for the Path panel, and possibly others. | |
var dojo = {}; | |
dojo.fromJson = function(/*String*/ json){ | |
return eval("(" + json + ")"); // Object | |
} |
This file contains hidden or 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
// =========================================================================== | |
try { (function() { | |
if (!fw.selection || !fw.selection.length) { | |
return; | |
} | |
var element = fw.selection[0], | |
info = { | |
name: element.name, |
OlderNewer