Skip to content

Instantly share code, notes, and snippets.

/*
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
@fwextensions
fwextensions / gist:77340
Created March 11, 2009 05:57
Fireworks: Saving and restoring the current selection
// 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;
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();