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 AmpersandState = require('ampersand-state'); | |
var AmpersandCollection = require('ampersand-collection'); | |
var View = require('ampersand-view'); | |
var NodeList = AmpersandCollection.extend({ | |
}); | |
var Node = AmpersandState.extend({ | |
props: { | |
id: 'string', |
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 AmpersandState = require('ampersand-state'); | |
var AmpersandCollection = require('ampersand-collection'); | |
var View = require('ampersand-view'); | |
var NodeList = AmpersandCollection.extend({ | |
}); | |
var Node = AmpersandState.extend({ | |
props: { | |
id: 'string', |
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 AmpersandView = require('ampersand-view'); | |
module.exports = AmpersandView.extend({ | |
initialize: function () { | |
var self = this; | |
app.people.getOrFetch(options.personId, function (err, person) { | |
if (err) { throw err; } | |
self.model = person; | |
}); |
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
// | |
// Lame implementation of a channel | |
function channel() { | |
return new Channel(); | |
} | |
var id = 0; | |
function Channel(opts) { | |
this._queue = []; |
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 View = require('ampersand-view'); | |
var MyView = View.extend({ | |
template: '<h1>Hello</h1>' | |
}); | |
var view = new MyView(); | |
view.render(); | |
document.body.appendChild(view.el); |
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 State = require('ampersand-state').extend({ | |
props: { | |
id: 'number', | |
age: 'number' | |
} | |
}); | |
var s = new State({ id: 1, age: 10 }) | |
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 View = require('ampersand-view').extend({ | |
template: '<div><input type="checkbox" ><a>click me</a></div>', | |
props: { | |
theState: 'boolean' | |
}, | |
events: { | |
'click [type=checkbox]': 'toggleState', | |
'click a': 'toggleState' | |
}, | |
bindings: { |
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 src = "<div class=\"landing\"><div class=\"container\"><section id=\"pages\"><section role=\"main\" class=\"page create\"><div class=\"room cf\"><a href=\"/\" title=\"Welcome to Talky!\" class=\"talky-logo\"></a><form id=\"createRoom\" class=\"cf\"><p>Truly simple video chat and screen sharing for small groups.</p><input id=\"sessionInput\" placeholder=\"Name the conversation\" autofocus=\"autofocus\" type=\"text\"><button type=\"submit\" class=\"primary large\">Let’s go!</button></form></div><div class=\"features cf\"><h2>Anonymous. Peer‑to‑peer. No plugins, signup, or payment required.</h2><div class=\"feature\"><h3>Group video chat</h3><p>Add up to 5 people to the conversation </p></div><div class=\"feature\"><h3>Screen sharing</h3><p>Easily add anyone's screen to the conversation</p></div><div class=\"feature\"><h3>Locked rooms</h3><p>Add a shared key to a room for added privacy</p></div><div class=\"feature\"><h3>Mobile, too!</h3><p> \nTalky iOS is available</p><a href=\"https://itunes.apple.com/app/ |
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 AmpersandModel = require('ampersand-model'); | |
var AmpersandCollection = require('ampersand-rest-collection'); | |
var Model = AmpersandModel.extend({ | |
props: { | |
title: 'string' | |
} | |
}); | |
var MyCollection = AmpersandCollection.extend({ |
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-collection'); | |
var SubCollection = require('ampersand-subcollection'); | |
var Model = require('ampersand-model'); | |
var MyModel = Model.extend({ | |
props: { | |
name: 'string', | |
selected: 'boolean' | |
} | |
}); |