This file contains 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
// /common/core/ampersand-input-view-dust.js | |
/** | |
* Extends the Ampersand InputView class to make it work with Dust templates | |
*/ | |
/*global dust*/ | |
var InputView = require('ampersand-input-view'); | |
var InputViewDust = InputView.extend({ | |
template: 'includes.formInput', | |
render: function () { | |
var self = this; |
This file contains 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 ViewSwitcher = require('ampersand-view-switcher'); | |
var View = require('ampersand-view'); | |
var domready = require('domready'); | |
var V = View.extend({ | |
template: '<div>Hello View Switcher!</div>' | |
}); | |
domready(function () { | |
var v = new V(); |
This file contains 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 Collection = require('ampersand-rest-collection'); | |
var AmpersandModel = require('ampersand-model'); | |
var Gallery = Collection.extend({ | |
model: function(attr) { | |
return new Gallery(); | |
}, | |
isModel: function(model) { | |
return model instanceof Gallery; |
This file contains 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
// require() some stuff from npm (like you were using browserify) | |
// and then hit Rebuild to run it on the right | |
var Collection = require('ampersand-rest-collection'); | |
var AmpersandModel = require('ampersand-model'); | |
var Gallery = Collection.extend({ | |
model: function(attr) { | |
return new Gallery(); | |
}, |
This file contains 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(window, undefined){ | |
window.Document = Backbone.Model.extend({ | |
url: function () { | |
var self = this, | |
base = '/' + self.database; | |
if (self.isNew()) |
This file contains 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 React from 'react'; | |
import styled from 'styled-components'; | |
const Item = styled.div` | |
margin-top: 1px; | |
padding: 15px; | |
background: #333; | |
${({first}) => first ? ` | |
margin-top: 0; |