Created
May 2, 2011 09:31
-
-
Save gazs/951363 to your computer and use it in GitHub Desktop.
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
| $(document).ready -> | |
| class Page extends Backbone.View | |
| render_template: (p) -> _.template($('#' + @template).html(), p) | |
| render: -> | |
| $(@el).html @render_template() | |
| super | |
| class Egyik extends Page | |
| template: 'egyik' | |
| class App extends Backbone.Controller | |
| routes: | |
| ':page': 'show' | |
| initialize: -> | |
| @egyik = new Egyik() | |
| replace_body: (page) -> | |
| $('body').children().remove() | |
| $('body').append(page) | |
| show: (page) -> | |
| @replace_body(@[page].render().el) | |
| window.app = new App() | |
| Backbone.history.start() |
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
| <script id="egyik" type="movealong/nothingtoseehere" charset="utf-8"> | |
| <div>egyik</div> | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment