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
import jQuery from 'jquery'; | |
export const attachEvents = someStr => { | |
jQuery(document).ready(e => { | |
// do something cool with someStr | |
}); | |
}; |
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 TeamMemberView = Chute.View.extend({ | |
template: _.template('<li><%= full_name %></li>'), | |
container: 'ul' | |
}); | |
var TeamView = Chute.CollectionView.extend({ | |
template: _.template('<ul></ul>'), | |
itemView: TeamMemberView | |
}); |
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 MyView = Chute.View.extend({ | |
events: { | |
'click a.someButton': 'doSomething', | |
'click a.anotherButton': function(e){ | |
// event fired | |
} | |
}, | |
doSomething: function(e){ | |
var $el = $(e.target); // getting a reference to an element, event was fired on |
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 MyView = Chute.View.extend({ | |
template: Chute.Utils.template('<div class="example"><h1>I am a view</h1></div>') | |
}); | |
var view = new MyView({ container: 'div.my-view' }); | |
view.render(); |
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 class="my-template" type="application/x-template"> | |
<div class="example"> | |
<h1>I am a view</h1> | |
</div> | |
</script> |
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 templateFn = Chute.Utils.template('<h1>{{ title }}</h1>'); | |
var renderedTemplate = templateFn({ title: 'Hello World' }); // <h1>Hello World</h1> |
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 MyView = Chute.View.extend({ | |
}); | |
var view = new MyView({ container: 'div.some-view' }); | |
view.render(); |
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 src="//static.getchute.com/chutejs/v1.0.2/chute.min.js" data-load="view,share"></script> |
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
{ | |
"meta": { | |
"version": 2, | |
"code": 200 | |
}, | |
"data": { | |
"id": "4fbaf4a21f92e4448c000003", | |
"source_url": "http://media.getchute.com/media/6onqswj", | |
"upload_info": { | |
"signature" : "AWS AKIAJHAREFXBAH6SBLPA:LC7MOI4gIdTs7uH2o0alJRiYdvg=", |
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
'Authorization': 'OAuth ABCDEFGHIJKLMNOPQRSTUV' // Your Private OAuth Token |