Created
January 5, 2012 16:56
-
-
Save tdegrunt/1566117 to your computer and use it in GitHub Desktop.
Working Canvastest for Batman
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Canvastest</title> | |
<meta http-equiv="X-UA-Compatible" content="IE=Edge" /> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script> | |
<script type="text/javascript" src="../lib/es5-shim.js"></script> | |
<script type="text/javascript" src="../lib/batman.js"></script> | |
<script type="text/javascript" src="../lib/batman.solo.js"></script> | |
<script type="text/javascript" src="../lib/coffee-script.js"></script> | |
</head> | |
<body> | |
<div id="container"> | |
<h1>Canvastest</h1> | |
<div data-view="CanvasView"></div> | |
</div> | |
<script type="text/coffeescript"> | |
# Create our application and namespace. | |
class Canvastest extends Batman.App | |
@global yes | |
# setup our root route. | |
@root 'app#index' | |
@on 'ready', -> | |
console.log "Canvastest ready" | |
class Canvastest.CanvasView extends Batman.View | |
html: '<canvas width="175" height="175" style="background: #ff0000"></canvas>' | |
render: -> | |
node = $(@get('node')) | |
node.html(@get('html')) | |
super | |
class Canvastest.AppController extends Batman.Controller | |
emptyTodo: null | |
index: -> | |
console.log "index action" | |
@render false | |
# Start the app. | |
Canvastest.run() | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment