View BaseModel.js
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
// First, define `nestedTypes` in your model. | |
// Each nested type may be a Model or Collection subtype. | |
window.app.viewer.Model.GallerySection = window.app.Model.BaseModel.extend({ | |
nestedTypes: { | |
background: window.app.viewer.Model.Image, | |
images: window.app.viewer.Collection.MediaCollection | |
} | |
}); |
View promise_scheduler.js
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
'use strict'; | |
var q = require('q'); | |
/** | |
* Constructs a function that proxies to promiseFactory | |
* limiting the count of promises that can run simultaneously. | |
* @param promiseFactory function that returns promises. | |
* @param limit how many promises are allowed to be running at the same time. | |
* @returns function that returns a promise that eventually proxies to promiseFactory. |
View gist:8253777
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 mongoose = require('mongoose') | |
, Q = require('q') | |
, Wallet = mongoose.model('Wallet') | |
, _ = require('underscore') | |
, bitcoin = require('bitcoin'); | |
function connect(coin) { | |
return new bitcoin.Client({ | |
host: coin.host, | |
port: coin.port, |
View feedback_widget.js
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
/** @jsx React.DOM */ | |
/* jshint trailing:false, quotmark:false, newcap:false */ | |
define(function (require) { | |
'use strict'; | |
var React = require('react'), | |
Promise = require('bluebird'), | |
$ = require('jquery'); |
View validation_mixin.js
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
define(function () { | |
'use strict'; | |
var _ = require('underscore'); | |
var ValidationMixin = { | |
getInitialState: function () { | |
return { | |
errors: [] |
View form_mixin.js
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
define(function () { | |
'use strict'; | |
var _ = require('underscore'); | |
var EDITABLE_STATE = 'editable', | |
SUBMITTING_STATE = 'submitting', | |
SUBMITTED_STATE = 'submitted'; |
View BackboneMixin.js
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
'use strict'; | |
var Backbone = require('backbone'), | |
_ = require('underscore'); | |
/** | |
* A mixin for watching for Backbone models and collections | |
* Usage: | |
* | |
* var SomeComponent = React.createClass({ |
View popover.js
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 Popover = React.createClass({ | |
mixins: [ClassNameMixin], | |
className: 'Popover', | |
propTypes: { | |
anchorOffset: React.PropTypes.oneOf(['normal', 'fromRoundBtn', 'fromSmallRoundBtn']), | |
expandFrom: React.PropTypes.shape({ | |
horizontal: React.PropTypes.oneOf(['left', 'center', 'right']).isRequired, |
View stores_and_pagination.js
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
// Assumes you're using normalizr https://github.com/gaearon/normalizr | |
// --------------- | |
// Helpers: | |
// --------------- | |
// StoreUtils | |
'use strict'; |
View smartasscomponents.js
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 Article = React.createClass({ | |
mixins: [createStoreMixin(ArticleStore)], | |
propTypes: { | |
articleId: PropTypes.number.isRequired | |
}, | |
getStateFromStores() { | |
return { | |
article: ArticleStore.get(this.props.articleId); |
OlderNewer