paperjs / paperjs.org

The source of the Paper.js website http://paperjs.org, translated to the static pages in https://github.com/paperjs/paperjs.github.io by running it through https://github.com/paperjs/woods in a Travis CI worker on each commit.
48 stars 34 forks source link

the tutorial code does not work #11

Closed Pomax closed 9 years ago

Pomax commented 9 years ago

The initial tutorial code on http://paperjs.org/tutorials/getting-started/working-with-paper-js,

<!DOCTYPE html>
<html>
<head>
<!-- Load the Paper.js library -->
<script type="text/javascript" src="js/paper.js"></script>
<!-- Define inlined PaperScript associate it with myCanvas -->
<script type="text/paperscript" canvas="myCanvas">
    // Create a Paper.js Path to draw a line into it:
    var path = new Path();
    // Give the stroke a color
    path.strokeColor = 'black';
    var start = new Point(100, 100);
    // Move to start and draw a line from there
    path.moveTo(start);
    // Note the plus operator on Point objects.
    // PaperScript does that for us, and much more!
    path.lineTo(start + [ 100, -50 ]);
</script>
</head>
<body>
    <canvas id="myCanvas" resize></canvas>
</body>
</html>

does not work with paperjs 0.9.23, instead throwing a parse error about a missing ], as can be seen in this jsbin: http://jsbin.com/kedixufiye/edit?html,output

lehni commented 9 years ago

I think there was something going wrong with and older versin of uglifyjs, the minifier we use. I republished a correct version while I really should have bumped the version number. Try loading the non-minified version from cloud fare to see if that fixes it.

Pomax commented 9 years ago

indeed, unminified works.http://jsbin.com/zawoquzika/edit?html,output

lehni commented 9 years ago

Great, thanks for confirming. Time for a new version then!