Created
August 14, 2012 19:26
-
-
Save skrat/3351977 to your computer and use it in GitHub Desktop.
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
class Path { | |
Path() {} | |
Path.parse(String data) { | |
return null; // mock | |
} | |
} | |
Document SVG = null; | |
Document ensureSvg(Function cb(Document svg)) { | |
if (SVG != null) { | |
cb(SVG) | |
} | |
var req = new XMLHttpRequest(); | |
req.on.load.add((_) { | |
SVG = req.response; | |
cb(SVG); | |
}); | |
req.responseType = 'document'; | |
req.open('get', 'carp.svg'); | |
req.send(); | |
} | |
SVGElement make(svg, Function cb) { | |
ensureSvg((Document svgDoc) { | |
var pathData = new Path.parse(svgDoc.query('#body').attributes['d']); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment