piskel/preview/js/app.js

36 lines
1.1 KiB
JavaScript
Raw Normal View History

2012-08-28 13:56:40 +04:00
// 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);