Skip to content

Instantly share code, notes, and snippets.

@fwextensions
Created May 5, 2012 18:55
Show Gist options
  • Save fwextensions/2604750 to your computer and use it in GitHub Desktop.
Save fwextensions/2604750 to your computer and use it in GitHub Desktop.
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],
extension = Files.getExtension(file);
if (extension == ".gif" || extension == ".png") {
dp.push({
label: Files.getFilename(file).match(/(.+)\.[^.]+/)[1],
icon: file
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment