Skip to content

Commit

Permalink
Merge branch 'master' into event-defaults
Browse files Browse the repository at this point in the history
Conflicts:
	CHANGELOG
  • Loading branch information
David Aurelio committed Jul 12, 2012
2 parents f5afd05 + 6b51a23 commit 0959da3
Show file tree
Hide file tree
Showing 29 changed files with 527 additions and 343 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
v0.2.1 / 2012-07-12
-------------------

* Aligned callback usage to use node-style single-callbacks. See https://github.com/uxebu/bonsai/pull/1
* Added an option to bonsai.run that allows browser events not to be preventDefault’ed:
`bonsai.run(node, {allowEventDefaults: true})`
see: https://github.com/uxebu/bonsai/pull/4

v0.2.0 / 2012-07-09
-------------------
Expand Down
5 changes: 0 additions & 5 deletions example/library/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,5 @@
});
});

function resolve(url) { //TODO: write own resolver
var a = document.createElement('a');
a.href = url;
return a.href;
}
</script>
</body>
16 changes: 7 additions & 9 deletions example/library/movies/assets/submovies/redpanda.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
new bonsai.Bitmap('../redpanda.jpg', {
onload: function() {
this.attr({
y: -256,
x: -256
});
stage.addChild(this);
this.animate('1s', {x: 0, y: 0, rotation: .2});
}
new bonsai.Bitmap('../redpanda.jpg', function(err) {
this.attr({
y: -256,
x: -256
});
stage.addChild(this);
this.animate('1s', {x: 0, y: 0, rotation: .2});
});
29 changes: 14 additions & 15 deletions example/library/movies/bitmap-move-rotation.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
new bonsai.Bitmap('assets/redpanda.jpg', {
onload: function() {
this.attr({
origin: {x: 128, y: 128},
y: -256,
x: -256
});
stage.addChild(this);
stage.addChild(bonsai.Shape.circle(250, 250, 128).attr({fillColor: 'rgba(255, 0, 0, .5)'}));
this.animate('5s', {
rotation: Math.PI * 10 + .2,
x: 149.61,
y: 98.41
});
}
new bonsai.Bitmap('assets/redpanda.jpg', function(err) {
if (err) return;
this.attr({
origin: {x: 128, y: 128},
y: -256,
x: -256
});
stage.addChild(this);
stage.addChild(bonsai.Shape.circle(250, 250, 128).attr({fillColor: 'rgba(255, 0, 0, .5)'}));
this.animate('5s', {
rotation: Math.PI * 10 + .2,
x: 149.61,
y: 98.41
});
});
17 changes: 8 additions & 9 deletions example/library/movies/bitmap.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
new bonsai.Bitmap('assets/redpanda.jpg', {
onload: function() {
this.attr({
y: -256,
x: -256
});
stage.addChild(this);
this.animate('1s', {x: 0, y: 0, rotation: .2});
}
new bonsai.Bitmap('assets/redpanda.jpg', function(err) {
if (err) return;
this.attr({
y: -256,
x: -256
});
stage.addChild(this);
this.animate('1s', {x: 0, y: 0, rotation: .2});
});
21 changes: 9 additions & 12 deletions example/library/movies/fill-image.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
new bonsai.Bitmap('assets/redpanda.jpg', {
onload: function() {

Shape.rect(0, 0, 400, 400).attr({
fillImage: this.attr({
width: 100,
height: 100
}),
fillRepeat: 4
}).addTo(stage);

}
new bonsai.Bitmap('assets/redpanda.jpg', function(err) {
if (err) return;
Shape.rect(0, 0, 400, 400).attr({
fillImage: this.attr({
width: 100,
height: 100
}),
fillRepeat: 4
}).addTo(stage);
});
221 changes: 105 additions & 116 deletions example/library/movies/filter-list.js
Original file line number Diff line number Diff line change
@@ -1,145 +1,134 @@

/* ============ ROW 1 ============ */

new bonsai.Bitmap('assets/redpanda.jpg', {
onload: function() {
this.attr({
y: 10,
x: 10,
scale: 0.5,
filters: filter.blur(1)
});
stage.addChild(this);
}
new bonsai.Bitmap('assets/redpanda.jpg', function(err) {
if (err) return;
this.attr({
y: 10,
x: 10,
scale: 0.5,
filters: filter.blur(1)
});
stage.addChild(this);
});

new bonsai.Bitmap('assets/redpanda.jpg', {
onload: function() {
this.attr({
y: 10,
x: 150,
scale: 0.5,
filters: filter.sepia(1)
});
stage.addChild(this);
}
new bonsai.Bitmap('assets/redpanda.jpg', function(err) {
if (err) return;
this.attr({
y: 10,
x: 150,
scale: 0.5,
filters: filter.sepia(1)
});
stage.addChild(this);
});

new bonsai.Bitmap('assets/redpanda.jpg', {
onload: function() {
this.attr({
y: 10,
x: 290,
scale: 0.5,
filters: filter.saturate(5)
});
stage.addChild(this);
}
new bonsai.Bitmap('assets/redpanda.jpg', function(err) {
if (err) return;
this.attr({
y: 10,
x: 290,
scale: 0.5,
filters: filter.saturate(5)
});
stage.addChild(this);
});

/* ============ ROW 2 ============ */

new bonsai.Bitmap('assets/redpanda.jpg', {
onload: function() {
this.attr({
y: 150,
x: 10,
scale: 0.5,
filters: filter.grayscale(1)
});
stage.addChild(this);
}
new bonsai.Bitmap('assets/redpanda.jpg', function(err) {
if (err) return;
this.attr({
y: 150,
x: 10,
scale: 0.5,
filters: filter.grayscale(1)
});
stage.addChild(this);
});

new bonsai.Bitmap('assets/redpanda.jpg', {
onload: function() {
this.attr({
y: 150,
x: 150,
scale: 0.5,
filters: filter.hueRotate(90)
});
stage.addChild(this);
}
new bonsai.Bitmap('assets/redpanda.jpg', function(err) {
if (err) return;
this.attr({
y: 150,
x: 150,
scale: 0.5,
filters: filter.hueRotate(90)
});
stage.addChild(this);
});

new bonsai.Bitmap('assets/redpanda.jpg', {
onload: function() {
this.attr({
y: 150,
x: 290,
scale: 0.5,
filters: filter.invert(1)
});
stage.addChild(this);
}
new bonsai.Bitmap('assets/redpanda.jpg', function(err) {
if (err) return;
this.attr({
y: 150,
x: 290,
scale: 0.5,
filters: filter.invert(1)
});
stage.addChild(this);
});

/* ============ ROW 3 ============ */

new bonsai.Bitmap('assets/redpanda.jpg', {
onload: function() {
this.attr({
y: 290,
x: 10,
scale: 0.5,
filters: filter.brightness(2)
});
stage.addChild(this);
}
new bonsai.Bitmap('assets/redpanda.jpg', function(err) {
if (err) return;
this.attr({
y: 290,
x: 10,
scale: 0.5,
filters: filter.brightness(2)
});
stage.addChild(this);
});

new bonsai.Bitmap('assets/redpanda.jpg', {
onload: function() {
this.attr({
y: 290,
x: 150,
scale: 0.5,
filters: filter.contrast(2)
});
stage.addChild(this);
}
new bonsai.Bitmap('assets/redpanda.jpg', function(err) {
if (err) return;
this.attr({
y: 290,
x: 150,
scale: 0.5,
filters: filter.contrast(2)
});
stage.addChild(this);
});

new bonsai.Bitmap('assets/redpanda.jpg', {
onload: function() {
this.attr({
y: 290,
x: 290,
scale: 0.5,
filters: filter.opacity(0.5)
});
stage.addChild(this);
}
new bonsai.Bitmap('assets/redpanda.jpg', function(err) {
if (err) return;
this.attr({
y: 290,
x: 290,
scale: 0.5,
filters: filter.opacity(0.5)
});
stage.addChild(this);
});

/* ============ ROW 4 ============ */

new bonsai.Bitmap('assets/redpanda.jpg', {
onload: function() {
this.attr({
y: 430,
x: 10,
scale: 0.5,
filters: filter.dropShadow([0,0,5,'#000'])
});
stage.addChild(this);
}
new bonsai.Bitmap('assets/redpanda.jpg', function(err) {
if (err) return;
this.attr({
y: 430,
x: 10,
scale: 0.5,
filters: filter.dropShadow([0,0,5,'#000'])
});
stage.addChild(this);
});

new bonsai.Bitmap('assets/redpanda.jpg', {
onload: function() {
this.attr({
y: 430,
x: 150,
scale: 0.5,
filters: filter.colorMatrix([
1, 1, 1, 0, 0,
1, 0.7, -1, 0, 0,
-1, -1, -1, 0, 0,
0, 0, 0, 1, 0
])
});
stage.addChild(this);
}
});
new bonsai.Bitmap('assets/redpanda.jpg', function(err) {
if (err) return;
this.attr({
y: 430,
x: 150,
scale: 0.5,
filters: filter.colorMatrix([
1, 1, 1, 0, 0,
1, 0.7, -1, 0, 0,
-1, -1, -1, 0, 0,
0, 0, 0, 1, 0
])
});
stage.addChild(this);
});
Loading

0 comments on commit 0959da3

Please sign in to comment.