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
for(var i = 0; i < component.children.length; i++) { | |
var child = component.children[i]; | |
// | |
} |
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
for child in component.children | |
// do stuff |
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
.embed { | |
#code { | |
.top { | |
position: relative; | |
height: 10px; | |
margin-top: 20px; | |
background-color: #eee; | |
border-top: 1px solid #ccc; | |
@include gradient-vertical(#eee, #ddd); |
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 DashboardRouter extends Backbone.Router | |
routes: | |
'': 'showPanel' | |
'dash/:panel': 'showPanel' | |
'dash/:panel/:subpanel': 'showPanel' |
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 DashboardView extends Backbone.View | |
initialize: -> | |
@router = new DashboardRouter | |
@router.on 'route:showPanel', @showPanel |
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
showPanel: (panel, subPanel) => | |
# Default the panel to 'projects' if it's empty | |
panel = panel or 'projects' | |
# Show the panel, toggle buttons, etc. | |
# ... |
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
enablePushState = true | |
pushState = !!(enablePushState && window.history && window.history.pushState) | |
if pushState | |
Backbone.history.start | |
pushState: true | |
root: '/' | |
else | |
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
$(document).on "click", "a[href^='/']", (event) -> | |
href = $(event.currentTarget).attr('href') | |
# Check if the link matches our route | |
passThrough = href.indexOf('/dash') != 0 | |
# Allow shift+click for new tabs, etc. | |
if !passThrough && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey | |
event.preventDefault() |
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
--- | |
layout: default | |
title: Welcome | |
--- | |
<div class="page-header"> | |
<h1>Jetstrap Docs</h1> | |
</div> | |
Welcome! |
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 ref = new Firebase("https://YOUR_FIREBASE_NAME.firebaseio.com/"); | |
ref.child("meta").once("value", function(snapshot) { | |
$("#feed > :first").html(snapshot.val().description); | |
}); | |
ref.child("articles").limit(10).on("child_added", function(snapshot) { | |
var article = snapshot.val(); | |
var link = $("<a>", {"href": article.link, "target": "_blank"}); | |
$("#feed").append($("<li>").append(link.html(article.title))); | |
$('#feed').listview('refresh'); | |
}); |