2013-11-03 06:10:35 -05:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2014-08-16 13:24:54 -04:00
|
|
|
<meta charset="UTF-8">
|
|
|
|
<title>Import From File</title>
|
|
|
|
<link rel="stylesheet" href="../css/style.css">
|
|
|
|
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
|
|
|
<script type="text/paperscript" canvas="canvas">
|
|
|
|
var file = document.getElementById('file');
|
|
|
|
file.addEventListener('change', function (event) {
|
|
|
|
var files = event.target.files;
|
|
|
|
for (var i = 0; i < files.length; i++) {
|
|
|
|
var file = files[i];
|
|
|
|
if (file.type.match('svg')) {
|
2014-09-27 16:59:45 -04:00
|
|
|
project.clear();
|
2014-08-16 13:24:54 -04:00
|
|
|
project.importSVG(file, function(item) {
|
|
|
|
console.log(item);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
2013-11-03 06:10:35 -05:00
|
|
|
</head>
|
|
|
|
<body>
|
2014-08-16 13:24:54 -04:00
|
|
|
<form>
|
|
|
|
<input type="file" id="file">
|
|
|
|
</form>
|
|
|
|
<canvas id="canvas" width="1000" height="1000"></canvas>
|
2013-11-03 06:10:35 -05:00
|
|
|
</body>
|
2014-04-06 07:44:19 -04:00
|
|
|
</html>
|