piskel/preview/js/app.js
Firstname Lastname a07b5c7f35 added preview
2012-08-28 11:56:40 +02:00

36 lines
1.1 KiB
JavaScript

// Generated by CoffeeScript 1.3.1
(function() {
$(document).ready(function() {
var Piskel;
Piskel = Em.Application.create();
Piskel.mainView = Em.View.create({
templateName: 'main',
onCanvasClick: function() {}
});
Piskel.mainView.append;
Piskel.Art = Ember.Object.extend({
setContext: function(context) {
this.context = context;
},
clear: function() {
this.context.save();
return this.context.clearRect(0, 0, this.context.canvas.width, this.context.canvas.height);
}
});
$('#main').ready(function() {
var context, mainCanvas;
mainCanvas = document.getElementById('main');
context = mainCanvas.getContext('2d');
context.save();
context.clearRect(0, 0, context.canvas.width, context.canvas.height);
context.fillStyle = 'white';
context.fillRect(0, 0, context.canvas.width, context.canvas.height);
context.restore();
return Piskel.mainCanvas = document.getElementById('main');
});
return window.Piskel = Piskel;
});
}).call(this);