mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
added preview
This commit is contained in:
35
preview/js/app.js
Normal file
35
preview/js/app.js
Normal file
@@ -0,0 +1,35 @@
|
||||
// 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);
|
||||
Reference in New Issue
Block a user