Skip to content

Commit cfe968d

Browse files
committed
Rename Document -> Project, DocumentView -> ProjectView, paper.document -> paper.project and paper.documents -> paper.projects, to avoid name clashing with window.document.
1 parent edd36e7 commit cfe968d

37 files changed

Lines changed: 699 additions & 183 deletions

examples/Animated/AnimatedStar.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<script type="text/javascript">var root = '../../'</script>
88
<script type="text/javascript" src="../../src/load.js"></script>
99
<script type="text/paperscript" canvas="canvas">
10-
var layer = document.activeLayer;
10+
var layer = project.activeLayer;
1111

1212
var values = {
1313
count: 34,
@@ -42,7 +42,7 @@
4242

4343
// Reposition the paths whenever the window is resized:
4444
function onResize(event) {
45-
document.activeLayer.position = view.center;
45+
project.activeLayer.position = view.center;
4646
}
4747
</script>
4848
</head>

examples/Animated/Flock.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// Adapted from Flocking Processing example by Daniel Schiffman:
1111
// http://processing.org/learning/topics/flocking.html
1212

13-
document.currentStyle = {
13+
project.currentStyle = {
1414
strokeColor: 'white',
1515
strokeWidth: 2,
1616
strokeCap: 'round'
@@ -281,7 +281,7 @@
281281
groupTogether = !groupTogether;
282282
}
283283

284-
var layer = document.activeLayer;
284+
var layer = project.activeLayer;
285285
function onKeyDown(event) {
286286
if (event.key == 'space') {
287287
layer.selected = !layer.selected;

examples/Animated/Lines.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
var position = view.center;
1919
var mousePos = position;
20-
var children = document.activeLayer.children;
20+
var children = project.activeLayer.children;
2121
var count = 0;
2222

2323
function iterate() {

examples/Animated/RoundedRectangles.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
mousePoint = event.point;
3030
}
3131

32-
var children = document.activeLayer.children;
32+
var children = project.activeLayer.children;
3333
function onFrame(event) {
3434
for (var i = 0, l = children.length; i < l; i++) {
3535
var item = children[i];

examples/Scripts/Arcs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
path.arcTo(point + vector, true);
2323
}
2424
}
25-
document.activeLayer.appendBottom(path);
25+
project.activeLayer.appendBottom(path);
2626
}
2727
</script>
2828
</head>

examples/Scripts/CompoundPath.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<script type="text/javascript">var root = '../../'</script>
88
<script type="text/javascript" src="../../src/load.js"></script>
99
<script type="text/paperscript" canvas="canvas">
10-
document.currentStyle.fillColor = 'black';
10+
project.currentStyle.fillColor = 'black';
1111
var path1 = new Path.Rectangle([200, 200], [100, 100]);
1212
var path2 = new Path.Rectangle([50, 50], [200, 200]);
1313
var path3 = new Path.Rectangle([0, 0], [400, 400]);

examples/Scripts/RotationRaster.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
}
2929
}
3030
}
31-
document.activeLayer.position = view.center;
31+
project.activeLayer.position = view.center;
3232

3333
// Reposition the paths whenever the window is resized:
3434
function onResize(event) {
35-
document.activeLayer.position = view.center;
35+
project.activeLayer.position = view.center;
3636
}
3737
</script>
3838
</head>

examples/Scripts/RoundRectangle.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<script type="text/paperscript" canvas="canvas">
1010
var path;
1111
var rect = new Rectangle([150, 150], [300, 300]);
12-
document.currentStyle.fillColor = 'black';
12+
project.currentStyle.fillColor = 'black';
1313

1414
function onFrame(event) {
1515
if (path)

examples/Tools/Circles.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<script type="text/paperscript" canvas="canvas">
1010
// All newly created items will receive
1111
// these style properties:
12-
document.currentStyle = {
12+
project.currentStyle = {
1313
fillColor: 'white',
1414
strokeColor: 'black'
1515
};

examples/Tools/Clouds.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<script type="text/javascript" src="../../src/load.js"></script>
99
<script type="text/paperscript" canvas="canvas">
1010
// Any newly created item will inherit the following styles:
11-
document.currentStyle = {
11+
project.currentStyle = {
1212
strokeColor: 'black',
1313
strokeWidth: 5,
1414
strokeJoin: 'round',

0 commit comments

Comments
 (0)