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
| var AppRouter = Backbone.Router.extend({ | |
| routes:{ | |
| "":"index", | |
| "test": function() { | |
| console.log("Test method"); | |
| }, | |
| "foo": function() { | |
| console.log("Foo method"); | |
| }, |
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
| items.each do |category| | |
| %li | |
| %a{:href => " "} | |
| = category.name |
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#container-fluid{ :type => 'text/template' } | |
| .container-fluid{ :style => "border: solid 1px;" } | |
| .sidebar | |
| = render '/audio_player' | |
| .content | |
| %a{ :href => 'test'} | |
| = "#{name}" | |
| #footer | |
| >>> |
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
| $(function() { | |
| var app = new App.BeamRouter(); | |
| App.Models.mainPage = new App.Models.MainPage({ title: "Test title" }); | |
| App.Views.mainLayout = new App.Views.MainLayout({ model: App.Models.mainPage }); | |
| $("#main").empty().append(App.Views.mainLayout.el); | |
| App.Views.mainLayout.render(); | |
| Backbone.history.start({pushState: true}); | |
| }); |
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#album-row{ :type => 'text/template' } | |
| .album-row | |
| <a href = "<%= id %>"><%= updated_at %></a> | |
| .song-row | |
| %p Something |
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
| - if resource.errors.any? | |
| .alert.alert-block.alert-error | |
| %h4.alert-heading | |
| = pluralize(@session.errors.count, "error") | |
| with form: | |
| %ul | |
| - @session.error.full_messages.each do |msg| | |
| %li= msg | |
| %span.control-group.error |
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
| App.Views.AlbumView = Backbone.Layout.extend({ | |
| manage: true, | |
| template: "#album-row", | |
| className: "album-row", | |
| events: { | |
| "click i.icon-play": "playAlbum" | |
| }, |
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
| foo -> | |
| console.log( 'foo' ) | |
| boo($) -> | |
| console.log($) | |
| (baz( ) -> | |
| console.log(arguments) | |
| )("foo") |
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
| <html> | |
| <head> | |
| <meta http-equiv="content-type" content="text/html; charset=utf-8" /> | |
| <title>Test Thing</title> | |
| <script src="underscore.js" type="text/javascript" charset="utf-8"></script> | |
| <script src="backbone.js" type="text/javascript" charset="utf-8"></script> | |
| <script src="santoor.js" type="text/javascript" charset="utf-8"></script> | |
| </head> | |
| <body> |
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
| class @Santoor extends Backbone.View | |
| constructor: (@templateId) -> | |
| render: -> | |
| console.log @templateId | |
| template = _.template($(@templateId).html()) | |
| // if I remove the constructor part and use | |
| // template = _.template($("#santoor-player").html()) | |
| // it works |