Created
May 5, 2012 18:55
-
-
Save fwextensions/2604750 to your computer and use it in GitHub Desktop.
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
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