diff --git a/README.md b/README.md
old mode 100644
new mode 100755
index 6215e05..28cb40b
--- a/README.md
+++ b/README.md
@@ -1,4 +1,40 @@
-react-flux-boilerplate
-======================
+## React FLUX Boilerplate
-A boilerplate for a full FLUX architecture
+Based on the architecture suggestions from Facebook, this boilerplate will help you deal with it. It has included the
+react-flux-dispatcher and react-flux-store. Read more about FLUX over at [Facebook Flux](http://facebook.github.io/flux/) and I wrote a post about it too: [React JS and FLUX](http://christianalfoni.github.io/javascript/2014/08/20/react-js-and-flux.html).
+
+### How to use
+
+* Clone the repo
+* Run `npm install`
+* Open `dev/index.html` or run `python -m SimpleHTTPServer` in the `dev` folder
+
+### Development
+* Run `gulp`
+* Any changes to `app` or `styles` folder will automatically rebuild to `dev` folder
+
+### Tests
+* Run `gulp test -'./tests/App-test.js'
+* Open `test.html`
+* Any changes done to the test file or files in `app` folder will autoreload the browser
+
+### Run all tests with Karma
+* Run `npm test`
+
+Karma will launch Chrome and run the tests once. If you need to run tests on a server with
+PhantomJS, either change `karma.conf.js` to use PhantomJS or manually start it with:
+`./node_modules/karma/bin/karma start --single-run --browsers PhantomJS`
+
+### Minify the code, ready for production
+* Run `gulp deploy`
+
+### Directory
+* **app/**: Where you develop the application
+* **dev/**: Where your automatically builds to. This is where you launch your app in development
+* **dist/**: Where the deployed code exists, ready for production
+* **utils/**: Gulp tasks and other utils
+* **styles/**: Where you put your css files
+* **tests/**: Where you put your test files
+* **gulpfile**: Gulp configuration
+* **karma.conf.js**: Karma configuration
+* **test.html**: Open when running specific test files
diff --git a/app/.DS_Store b/app/.DS_Store
new file mode 100755
index 0000000..5008ddf
Binary files /dev/null and b/app/.DS_Store differ
diff --git a/app/App.js b/app/App.js
new file mode 100755
index 0000000..819b413
--- /dev/null
+++ b/app/App.js
@@ -0,0 +1,18 @@
+/** @jsx React.DOM */
+var React = require('flux-react');
+var Checkboxes = require('./components/Checkboxes.js');
+var NameThrower = require('./components/NameThrower.js');
+
+var App = React.createClass({
+ render: function() {
+ return (
+
+
Hello world!
+
+
+
+ );
+ }
+});
+
+module.exports = App;
diff --git a/app/Constants.js b/app/Constants.js
new file mode 100644
index 0000000..7572f11
--- /dev/null
+++ b/app/Constants.js
@@ -0,0 +1,3 @@
+module.exports = {
+ EVENT_CHANGE: 'change'
+};
\ No newline at end of file
diff --git a/app/actions/CheckboxActions.js b/app/actions/CheckboxActions.js
new file mode 100644
index 0000000..82bea44
--- /dev/null
+++ b/app/actions/CheckboxActions.js
@@ -0,0 +1,5 @@
+module.exports = {
+ 'CHECK_ALL': 'check all',
+ 'UNCHECK_ALL': 'uncheck all',
+ 'CHECK': 'check'
+};
\ No newline at end of file
diff --git a/app/components/Checkboxes.js b/app/components/Checkboxes.js
new file mode 100644
index 0000000..83e9fbb
--- /dev/null
+++ b/app/components/Checkboxes.js
@@ -0,0 +1,51 @@
+/** @jsx React.DOM */
+var React = require('flux-react');
+var Constants = require('../Constants.js');
+var ColoredCheckbox = require('./Checkboxes/ColoredCheckbox.js');
+var CheckboxActions = require('../actions/CheckboxActions.js');
+var CheckboxStore = require('../stores/CheckboxStore.js');
+
+var Checkboxes = React.createClass({
+ stores: [CheckboxStore],
+ getInitialState: function () {
+ return {
+ checkboxes: CheckboxStore.getCheckboxes()
+ };
+ },
+ storesDidUpdate: function () {
+ this.setState({
+ checkboxes: CheckboxStore.getCheckboxes()
+ });
+ },
+ check: function (color) {
+ React.dispatch({
+ type: CheckboxActions.CHECK,
+ color: color
+ })
+ },
+ checkAll: function () {
+ React.dispatch({
+ type: CheckboxActions.CHECK_ALL
+ });
+ },
+ uncheckAll: function () {
+ React.dispatch({
+ type: CheckboxActions.UNCHECK_ALL
+ });
+ },
+ render: function() {
+ var checkboxes = this.state.checkboxes.map(function (checkbox, index) {
+ return
+ }, this);
+ return (
+
+ {checkboxes}
+ Check all
+ Uncheck all
+
+ );
+ }
+
+});
+
+module.exports = Checkboxes;
diff --git a/app/components/Checkboxes/ColoredCheckbox.js b/app/components/Checkboxes/ColoredCheckbox.js
new file mode 100644
index 0000000..e508044
--- /dev/null
+++ b/app/components/Checkboxes/ColoredCheckbox.js
@@ -0,0 +1,21 @@
+/** @jsx React.DOM */
+var React = require('flux-react');
+
+var ColoredCheckbox = React.createClass({
+ render: function() {
+ var style = {
+ backgroundColor: this.props.color,
+ padding: '5px'
+ };
+ return (
+
+
+
+ );
+ }
+
+});
+
+module.exports = ColoredCheckbox;
diff --git a/app/components/NameThrower.js b/app/components/NameThrower.js
new file mode 100644
index 0000000..bb06205
--- /dev/null
+++ b/app/components/NameThrower.js
@@ -0,0 +1,39 @@
+/** @jsx React.DOM */
+var React = require('flux-react');
+var Constants = require('../Constants.js');
+var CheckboxStore = require('../stores/CheckboxStore.js');
+
+var NameThrower = React.createClass({
+ stores: [CheckboxStore],
+ getInitialState: function () {
+ return {
+ name: '',
+ colors: CheckboxStore.getColors()
+ };
+ },
+ storesDidUpdate: function () {
+ this.setState({
+ colors: CheckboxStore.getColors()
+ });
+ },
+ updateName: function () {
+ this.setState({
+ name: this.refs.input.getDOMNode().value
+ });
+ },
+ render: function() {
+ var names = this.state.colors.map(function (color, index) {
+ var style = {color: color};
+ return {this.state.name}
+ }, this);
+ return (
+
+
+ {names}
+
+ );
+ }
+
+});
+
+module.exports = NameThrower;
diff --git a/app/main.js b/app/main.js
new file mode 100755
index 0000000..c2be6ea
--- /dev/null
+++ b/app/main.js
@@ -0,0 +1,6 @@
+/** @jsx React.DOM */
+var React = require('flux-react');
+React.debug();
+
+var App = require('./App.js');
+React.renderComponent( , document.body);
\ No newline at end of file
diff --git a/app/stores/CheckboxStore.js b/app/stores/CheckboxStore.js
new file mode 100644
index 0000000..54e80ac
--- /dev/null
+++ b/app/stores/CheckboxStore.js
@@ -0,0 +1,63 @@
+var React = require('flux-react');
+var merge = require('react/lib/merge');
+var CheckboxActions = require('../actions/CheckboxActions.js');
+var mergeInto = require('react/lib/mergeInto');
+var Constants = require('../Constants.js');
+
+var checkboxes = [{
+ color: 'red',
+ checked: false
+}, {
+ color: 'blue',
+ checked: false
+}, {
+ color: 'green',
+ checked: false
+}];
+
+var CheckboxStore = React.createStore({
+
+ getCheckboxes: function () {
+ return checkboxes.map(function (checkbox) {
+ var checkboxCopy = {};
+ mergeInto(checkboxCopy, checkbox); // Create a copy to make it impossible to mutate store
+ return checkboxCopy;
+ });
+ },
+ getColors: function () {
+ return checkboxes.map(function (checkbox) {
+ if (checkbox.checked) {
+ return checkbox.color;
+ } else {
+ return 'black';
+ }
+ });
+ },
+ dispatch: function (payload) {
+ switch (payload.type) {
+ case CheckboxActions.CHECK_ALL:
+ checkboxes.forEach(function (checkbox) {
+ checkbox.checked = true;
+ });
+ break;
+
+ case CheckboxActions.UNCHECK_ALL:
+ checkboxes.forEach(function (checkbox) {
+ checkbox.checked = false;
+ });
+ break;
+
+ case CheckboxActions.CHECK:
+ checkboxes.forEach(function (checkbox) {
+ if (checkbox.color === payload.color) {
+ checkbox.checked = !checkbox.checked;
+ }
+ });
+ break;
+ }
+ this.flush();
+ }
+
+});
+
+module.exports = CheckboxStore;
\ No newline at end of file
diff --git a/dev/index.html b/dev/index.html
new file mode 100644
index 0000000..148904f
--- /dev/null
+++ b/dev/index.html
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dev/main.css b/dev/main.css
new file mode 100644
index 0000000..c9488c3
--- /dev/null
+++ b/dev/main.css
@@ -0,0 +1,4 @@
+body {
+ background-color: #EAEAEA;
+ zoom: 150%;
+}
diff --git a/dev/main.js b/dev/main.js
new file mode 100755
index 0000000..3ab3814
--- /dev/null
+++ b/dev/main.js
@@ -0,0 +1,20045 @@
+!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.ReactDispatcher=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 0 && this._events[type].length > m) {
+ this._events[type].warned = true;
+ console.error('(node) warning: possible EventEmitter memory ' +
+ 'leak detected. %d listeners added. ' +
+ 'Use emitter.setMaxListeners() to increase limit.',
+ this._events[type].length);
+ if (typeof console.trace === 'function') {
+ // not supported in IE 10
+ console.trace();
+ }
+ }
+ }
+
+ return this;
+};
+
+EventEmitter.prototype.on = EventEmitter.prototype.addListener;
+
+EventEmitter.prototype.once = function(type, listener) {
+ if (!isFunction(listener))
+ throw TypeError('listener must be a function');
+
+ var fired = false;
+
+ function g() {
+ this.removeListener(type, g);
+
+ if (!fired) {
+ fired = true;
+ listener.apply(this, arguments);
+ }
+ }
+
+ g.listener = listener;
+ this.on(type, g);
+
+ return this;
+};
+
+// emits a 'removeListener' event iff the listener was removed
+EventEmitter.prototype.removeListener = function(type, listener) {
+ var list, position, length, i;
+
+ if (!isFunction(listener))
+ throw TypeError('listener must be a function');
+
+ if (!this._events || !this._events[type])
+ return this;
+
+ list = this._events[type];
+ length = list.length;
+ position = -1;
+
+ if (list === listener ||
+ (isFunction(list.listener) && list.listener === listener)) {
+ delete this._events[type];
+ if (this._events.removeListener)
+ this.emit('removeListener', type, listener);
+
+ } else if (isObject(list)) {
+ for (i = length; i-- > 0;) {
+ if (list[i] === listener ||
+ (list[i].listener && list[i].listener === listener)) {
+ position = i;
+ break;
+ }
+ }
+
+ if (position < 0)
+ return this;
+
+ if (list.length === 1) {
+ list.length = 0;
+ delete this._events[type];
+ } else {
+ list.splice(position, 1);
+ }
+
+ if (this._events.removeListener)
+ this.emit('removeListener', type, listener);
+ }
+
+ return this;
+};
+
+EventEmitter.prototype.removeAllListeners = function(type) {
+ var key, listeners;
+
+ if (!this._events)
+ return this;
+
+ // not listening for removeListener, no need to emit
+ if (!this._events.removeListener) {
+ if (arguments.length === 0)
+ this._events = {};
+ else if (this._events[type])
+ delete this._events[type];
+ return this;
+ }
+
+ // emit removeListener for all listeners on all events
+ if (arguments.length === 0) {
+ for (key in this._events) {
+ if (key === 'removeListener') continue;
+ this.removeAllListeners(key);
+ }
+ this.removeAllListeners('removeListener');
+ this._events = {};
+ return this;
+ }
+
+ listeners = this._events[type];
+
+ if (isFunction(listeners)) {
+ this.removeListener(type, listeners);
+ } else {
+ // LIFO order
+ while (listeners.length)
+ this.removeListener(type, listeners[listeners.length - 1]);
+ }
+ delete this._events[type];
+
+ return this;
+};
+
+EventEmitter.prototype.listeners = function(type) {
+ var ret;
+ if (!this._events || !this._events[type])
+ ret = [];
+ else if (isFunction(this._events[type]))
+ ret = [this._events[type]];
+ else
+ ret = this._events[type].slice();
+ return ret;
+};
+
+EventEmitter.listenerCount = function(emitter, type) {
+ var ret;
+ if (!emitter._events || !emitter._events[type])
+ ret = 0;
+ else if (isFunction(emitter._events[type]))
+ ret = 1;
+ else
+ ret = emitter._events[type].length;
+ return ret;
+};
+
+function isFunction(arg) {
+ return typeof arg === 'function';
+}
+
+function isNumber(arg) {
+ return typeof arg === 'number';
+}
+
+function isObject(arg) {
+ return typeof arg === 'object' && arg !== null;
+}
+
+function isUndefined(arg) {
+ return arg === void 0;
+}
+
+},{}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/browserify/node_modules/process/browser.js":[function(require,module,exports){
+// shim for using process in browser
+
+var process = module.exports = {};
+
+process.nextTick = (function () {
+ var canSetImmediate = typeof window !== 'undefined'
+ && window.setImmediate;
+ var canPost = typeof window !== 'undefined'
+ && window.postMessage && window.addEventListener
+ ;
+
+ if (canSetImmediate) {
+ return function (f) { return window.setImmediate(f) };
+ }
+
+ if (canPost) {
+ var queue = [];
+ window.addEventListener('message', function (ev) {
+ var source = ev.source;
+ if ((source === window || source === null) && ev.data === 'process-tick') {
+ ev.stopPropagation();
+ if (queue.length > 0) {
+ var fn = queue.shift();
+ fn();
+ }
+ }
+ }, true);
+
+ return function nextTick(fn) {
+ queue.push(fn);
+ window.postMessage('process-tick', '*');
+ };
+ }
+
+ return function nextTick(fn) {
+ setTimeout(fn, 0);
+ };
+})();
+
+process.title = 'browser';
+process.browser = true;
+process.env = {};
+process.argv = [];
+
+function noop() {}
+
+process.on = noop;
+process.addListener = noop;
+process.once = noop;
+process.off = noop;
+process.removeListener = noop;
+process.removeAllListeners = noop;
+process.emit = noop;
+
+process.binding = function (name) {
+ throw new Error('process.binding is not supported');
+}
+
+// TODO(shtylman)
+process.cwd = function () { return '/' };
+process.chdir = function (dir) {
+ throw new Error('process.chdir is not supported');
+};
+
+},{}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/main.js":[function(require,module,exports){
+"use strict";
+var Promise = require("./promise/promise").Promise;
+var polyfill = require("./promise/polyfill").polyfill;
+exports.Promise = Promise;
+exports.polyfill = polyfill;
+},{"./promise/polyfill":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/promise/polyfill.js","./promise/promise":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/promise/promise.js"}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/promise/all.js":[function(require,module,exports){
+"use strict";
+/* global toString */
+
+var isArray = require("./utils").isArray;
+var isFunction = require("./utils").isFunction;
+
+/**
+ Returns a promise that is fulfilled when all the given promises have been
+ fulfilled, or rejected if any of them become rejected. The return promise
+ is fulfilled with an array that gives all the values in the order they were
+ passed in the `promises` array argument.
+
+ Example:
+
+ ```javascript
+ var promise1 = RSVP.resolve(1);
+ var promise2 = RSVP.resolve(2);
+ var promise3 = RSVP.resolve(3);
+ var promises = [ promise1, promise2, promise3 ];
+
+ RSVP.all(promises).then(function(array){
+ // The array here would be [ 1, 2, 3 ];
+ });
+ ```
+
+ If any of the `promises` given to `RSVP.all` are rejected, the first promise
+ that is rejected will be given as an argument to the returned promises's
+ rejection handler. For example:
+
+ Example:
+
+ ```javascript
+ var promise1 = RSVP.resolve(1);
+ var promise2 = RSVP.reject(new Error("2"));
+ var promise3 = RSVP.reject(new Error("3"));
+ var promises = [ promise1, promise2, promise3 ];
+
+ RSVP.all(promises).then(function(array){
+ // Code here never runs because there are rejected promises!
+ }, function(error) {
+ // error.message === "2"
+ });
+ ```
+
+ @method all
+ @for RSVP
+ @param {Array} promises
+ @param {String} label
+ @return {Promise} promise that is fulfilled when all `promises` have been
+ fulfilled, or rejected if any of them become rejected.
+*/
+function all(promises) {
+ /*jshint validthis:true */
+ var Promise = this;
+
+ if (!isArray(promises)) {
+ throw new TypeError('You must pass an array to all.');
+ }
+
+ return new Promise(function(resolve, reject) {
+ var results = [], remaining = promises.length,
+ promise;
+
+ if (remaining === 0) {
+ resolve([]);
+ }
+
+ function resolver(index) {
+ return function(value) {
+ resolveAll(index, value);
+ };
+ }
+
+ function resolveAll(index, value) {
+ results[index] = value;
+ if (--remaining === 0) {
+ resolve(results);
+ }
+ }
+
+ for (var i = 0; i < promises.length; i++) {
+ promise = promises[i];
+
+ if (promise && isFunction(promise.then)) {
+ promise.then(resolver(i), reject);
+ } else {
+ resolveAll(i, promise);
+ }
+ }
+ });
+}
+
+exports.all = all;
+},{"./utils":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/promise/utils.js"}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/promise/asap.js":[function(require,module,exports){
+(function (process,global){
+"use strict";
+var browserGlobal = (typeof window !== 'undefined') ? window : {};
+var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
+var local = (typeof global !== 'undefined') ? global : (this === undefined? window:this);
+
+// node
+function useNextTick() {
+ return function() {
+ process.nextTick(flush);
+ };
+}
+
+function useMutationObserver() {
+ var iterations = 0;
+ var observer = new BrowserMutationObserver(flush);
+ var node = document.createTextNode('');
+ observer.observe(node, { characterData: true });
+
+ return function() {
+ node.data = (iterations = ++iterations % 2);
+ };
+}
+
+function useSetTimeout() {
+ return function() {
+ local.setTimeout(flush, 1);
+ };
+}
+
+var queue = [];
+function flush() {
+ for (var i = 0; i < queue.length; i++) {
+ var tuple = queue[i];
+ var callback = tuple[0], arg = tuple[1];
+ callback(arg);
+ }
+ queue = [];
+}
+
+var scheduleFlush;
+
+// Decide what async method to use to triggering processing of queued callbacks:
+if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
+ scheduleFlush = useNextTick();
+} else if (BrowserMutationObserver) {
+ scheduleFlush = useMutationObserver();
+} else {
+ scheduleFlush = useSetTimeout();
+}
+
+function asap(callback, arg) {
+ var length = queue.push([callback, arg]);
+ if (length === 1) {
+ // If length is 1, that means that we need to schedule an async flush.
+ // If additional callbacks are queued before the queue is flushed, they
+ // will be processed by this flush that we are scheduling.
+ scheduleFlush();
+ }
+}
+
+exports.asap = asap;
+}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+},{"_process":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/browserify/node_modules/process/browser.js"}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/promise/config.js":[function(require,module,exports){
+"use strict";
+var config = {
+ instrument: false
+};
+
+function configure(name, value) {
+ if (arguments.length === 2) {
+ config[name] = value;
+ } else {
+ return config[name];
+ }
+}
+
+exports.config = config;
+exports.configure = configure;
+},{}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/promise/polyfill.js":[function(require,module,exports){
+(function (global){
+"use strict";
+/*global self*/
+var RSVPPromise = require("./promise").Promise;
+var isFunction = require("./utils").isFunction;
+
+function polyfill() {
+ var local;
+
+ if (typeof global !== 'undefined') {
+ local = global;
+ } else if (typeof window !== 'undefined' && window.document) {
+ local = window;
+ } else {
+ local = self;
+ }
+
+ var es6PromiseSupport =
+ "Promise" in local &&
+ // Some of these methods are missing from
+ // Firefox/Chrome experimental implementations
+ "resolve" in local.Promise &&
+ "reject" in local.Promise &&
+ "all" in local.Promise &&
+ "race" in local.Promise &&
+ // Older version of the spec had a resolver object
+ // as the arg rather than a function
+ (function() {
+ var resolve;
+ new local.Promise(function(r) { resolve = r; });
+ return isFunction(resolve);
+ }());
+
+ if (!es6PromiseSupport) {
+ local.Promise = RSVPPromise;
+ }
+}
+
+exports.polyfill = polyfill;
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+},{"./promise":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/promise/promise.js","./utils":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/promise/utils.js"}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/promise/promise.js":[function(require,module,exports){
+"use strict";
+var config = require("./config").config;
+var configure = require("./config").configure;
+var objectOrFunction = require("./utils").objectOrFunction;
+var isFunction = require("./utils").isFunction;
+var now = require("./utils").now;
+var all = require("./all").all;
+var race = require("./race").race;
+var staticResolve = require("./resolve").resolve;
+var staticReject = require("./reject").reject;
+var asap = require("./asap").asap;
+
+var counter = 0;
+
+config.async = asap; // default async is asap;
+
+function Promise(resolver) {
+ if (!isFunction(resolver)) {
+ throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
+ }
+
+ if (!(this instanceof Promise)) {
+ throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
+ }
+
+ this._subscribers = [];
+
+ invokeResolver(resolver, this);
+}
+
+function invokeResolver(resolver, promise) {
+ function resolvePromise(value) {
+ resolve(promise, value);
+ }
+
+ function rejectPromise(reason) {
+ reject(promise, reason);
+ }
+
+ try {
+ resolver(resolvePromise, rejectPromise);
+ } catch(e) {
+ rejectPromise(e);
+ }
+}
+
+function invokeCallback(settled, promise, callback, detail) {
+ var hasCallback = isFunction(callback),
+ value, error, succeeded, failed;
+
+ if (hasCallback) {
+ try {
+ value = callback(detail);
+ succeeded = true;
+ } catch(e) {
+ failed = true;
+ error = e;
+ }
+ } else {
+ value = detail;
+ succeeded = true;
+ }
+
+ if (handleThenable(promise, value)) {
+ return;
+ } else if (hasCallback && succeeded) {
+ resolve(promise, value);
+ } else if (failed) {
+ reject(promise, error);
+ } else if (settled === FULFILLED) {
+ resolve(promise, value);
+ } else if (settled === REJECTED) {
+ reject(promise, value);
+ }
+}
+
+var PENDING = void 0;
+var SEALED = 0;
+var FULFILLED = 1;
+var REJECTED = 2;
+
+function subscribe(parent, child, onFulfillment, onRejection) {
+ var subscribers = parent._subscribers;
+ var length = subscribers.length;
+
+ subscribers[length] = child;
+ subscribers[length + FULFILLED] = onFulfillment;
+ subscribers[length + REJECTED] = onRejection;
+}
+
+function publish(promise, settled) {
+ var child, callback, subscribers = promise._subscribers, detail = promise._detail;
+
+ for (var i = 0; i < subscribers.length; i += 3) {
+ child = subscribers[i];
+ callback = subscribers[i + settled];
+
+ invokeCallback(settled, child, callback, detail);
+ }
+
+ promise._subscribers = null;
+}
+
+Promise.prototype = {
+ constructor: Promise,
+
+ _state: undefined,
+ _detail: undefined,
+ _subscribers: undefined,
+
+ then: function(onFulfillment, onRejection) {
+ var promise = this;
+
+ var thenPromise = new this.constructor(function() {});
+
+ if (this._state) {
+ var callbacks = arguments;
+ config.async(function invokePromiseCallback() {
+ invokeCallback(promise._state, thenPromise, callbacks[promise._state - 1], promise._detail);
+ });
+ } else {
+ subscribe(this, thenPromise, onFulfillment, onRejection);
+ }
+
+ return thenPromise;
+ },
+
+ 'catch': function(onRejection) {
+ return this.then(null, onRejection);
+ }
+};
+
+Promise.all = all;
+Promise.race = race;
+Promise.resolve = staticResolve;
+Promise.reject = staticReject;
+
+function handleThenable(promise, value) {
+ var then = null,
+ resolved;
+
+ try {
+ if (promise === value) {
+ throw new TypeError("A promises callback cannot return that same promise.");
+ }
+
+ if (objectOrFunction(value)) {
+ then = value.then;
+
+ if (isFunction(then)) {
+ then.call(value, function(val) {
+ if (resolved) { return true; }
+ resolved = true;
+
+ if (value !== val) {
+ resolve(promise, val);
+ } else {
+ fulfill(promise, val);
+ }
+ }, function(val) {
+ if (resolved) { return true; }
+ resolved = true;
+
+ reject(promise, val);
+ });
+
+ return true;
+ }
+ }
+ } catch (error) {
+ if (resolved) { return true; }
+ reject(promise, error);
+ return true;
+ }
+
+ return false;
+}
+
+function resolve(promise, value) {
+ if (promise === value) {
+ fulfill(promise, value);
+ } else if (!handleThenable(promise, value)) {
+ fulfill(promise, value);
+ }
+}
+
+function fulfill(promise, value) {
+ if (promise._state !== PENDING) { return; }
+ promise._state = SEALED;
+ promise._detail = value;
+
+ config.async(publishFulfillment, promise);
+}
+
+function reject(promise, reason) {
+ if (promise._state !== PENDING) { return; }
+ promise._state = SEALED;
+ promise._detail = reason;
+
+ config.async(publishRejection, promise);
+}
+
+function publishFulfillment(promise) {
+ publish(promise, promise._state = FULFILLED);
+}
+
+function publishRejection(promise) {
+ publish(promise, promise._state = REJECTED);
+}
+
+exports.Promise = Promise;
+},{"./all":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/promise/all.js","./asap":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/promise/asap.js","./config":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/promise/config.js","./race":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/promise/race.js","./reject":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/promise/reject.js","./resolve":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/promise/resolve.js","./utils":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/promise/utils.js"}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/promise/race.js":[function(require,module,exports){
+"use strict";
+/* global toString */
+var isArray = require("./utils").isArray;
+
+/**
+ `RSVP.race` allows you to watch a series of promises and act as soon as the
+ first promise given to the `promises` argument fulfills or rejects.
+
+ Example:
+
+ ```javascript
+ var promise1 = new RSVP.Promise(function(resolve, reject){
+ setTimeout(function(){
+ resolve("promise 1");
+ }, 200);
+ });
+
+ var promise2 = new RSVP.Promise(function(resolve, reject){
+ setTimeout(function(){
+ resolve("promise 2");
+ }, 100);
+ });
+
+ RSVP.race([promise1, promise2]).then(function(result){
+ // result === "promise 2" because it was resolved before promise1
+ // was resolved.
+ });
+ ```
+
+ `RSVP.race` is deterministic in that only the state of the first completed
+ promise matters. For example, even if other promises given to the `promises`
+ array argument are resolved, but the first completed promise has become
+ rejected before the other promises became fulfilled, the returned promise
+ will become rejected:
+
+ ```javascript
+ var promise1 = new RSVP.Promise(function(resolve, reject){
+ setTimeout(function(){
+ resolve("promise 1");
+ }, 200);
+ });
+
+ var promise2 = new RSVP.Promise(function(resolve, reject){
+ setTimeout(function(){
+ reject(new Error("promise 2"));
+ }, 100);
+ });
+
+ RSVP.race([promise1, promise2]).then(function(result){
+ // Code here never runs because there are rejected promises!
+ }, function(reason){
+ // reason.message === "promise2" because promise 2 became rejected before
+ // promise 1 became fulfilled
+ });
+ ```
+
+ @method race
+ @for RSVP
+ @param {Array} promises array of promises to observe
+ @param {String} label optional string for describing the promise returned.
+ Useful for tooling.
+ @return {Promise} a promise that becomes fulfilled with the value the first
+ completed promises is resolved with if the first completed promise was
+ fulfilled, or rejected with the reason that the first completed promise
+ was rejected with.
+*/
+function race(promises) {
+ /*jshint validthis:true */
+ var Promise = this;
+
+ if (!isArray(promises)) {
+ throw new TypeError('You must pass an array to race.');
+ }
+ return new Promise(function(resolve, reject) {
+ var results = [], promise;
+
+ for (var i = 0; i < promises.length; i++) {
+ promise = promises[i];
+
+ if (promise && typeof promise.then === 'function') {
+ promise.then(resolve, reject);
+ } else {
+ resolve(promise);
+ }
+ }
+ });
+}
+
+exports.race = race;
+},{"./utils":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/promise/utils.js"}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/promise/reject.js":[function(require,module,exports){
+"use strict";
+/**
+ `RSVP.reject` returns a promise that will become rejected with the passed
+ `reason`. `RSVP.reject` is essentially shorthand for the following:
+
+ ```javascript
+ var promise = new RSVP.Promise(function(resolve, reject){
+ reject(new Error('WHOOPS'));
+ });
+
+ promise.then(function(value){
+ // Code here doesn't run because the promise is rejected!
+ }, function(reason){
+ // reason.message === 'WHOOPS'
+ });
+ ```
+
+ Instead of writing the above, your code now simply becomes the following:
+
+ ```javascript
+ var promise = RSVP.reject(new Error('WHOOPS'));
+
+ promise.then(function(value){
+ // Code here doesn't run because the promise is rejected!
+ }, function(reason){
+ // reason.message === 'WHOOPS'
+ });
+ ```
+
+ @method reject
+ @for RSVP
+ @param {Any} reason value that the returned promise will be rejected with.
+ @param {String} label optional string for identifying the returned promise.
+ Useful for tooling.
+ @return {Promise} a promise that will become rejected with the given
+ `reason`.
+*/
+function reject(reason) {
+ /*jshint validthis:true */
+ var Promise = this;
+
+ return new Promise(function (resolve, reject) {
+ reject(reason);
+ });
+}
+
+exports.reject = reject;
+},{}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/promise/resolve.js":[function(require,module,exports){
+"use strict";
+function resolve(value) {
+ /*jshint validthis:true */
+ if (value && typeof value === 'object' && value.constructor === this) {
+ return value;
+ }
+
+ var Promise = this;
+
+ return new Promise(function(resolve) {
+ resolve(value);
+ });
+}
+
+exports.resolve = resolve;
+},{}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/promise/utils.js":[function(require,module,exports){
+"use strict";
+function objectOrFunction(x) {
+ return isFunction(x) || (typeof x === "object" && x !== null);
+}
+
+function isFunction(x) {
+ return typeof x === "function";
+}
+
+function isArray(x) {
+ return Object.prototype.toString.call(x) === "[object Array]";
+}
+
+// Date.now is not available in browsers < IE9
+// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now#Compatibility
+var now = Date.now || function() { return new Date().getTime(); };
+
+
+exports.objectOrFunction = objectOrFunction;
+exports.isFunction = isFunction;
+exports.isArray = isArray;
+exports.now = now;
+},{}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/flux-react/app/ExtendedComponent.js":[function(require,module,exports){
+(function (process){
+
+function ExtendedComponent (dispatcher, props) {
+ var componentStores = [];
+ if (props.stores) {
+ props.stores.forEach(function (store) {
+ componentStores.push(store);
+ });
+
+ if (props.storesDidUpdate) {
+ /* Only update the stores on first event from the stores, then block until
+ next tick. This is due to storesDidUpdate() should only be called once and
+ the stores has synchronous behaviour in terms of triggering the event */
+ var doUpdate = true;
+ this.storesDidUpdate = function () {
+ if (doUpdate) {
+ props.storesDidUpdate.call(this);
+ doUpdate = false;
+ process.nextTick(function () {
+ doUpdate = true;
+ });
+ }
+ };
+ this.componentDidMount = function () {
+ componentStores.forEach(function (store) {
+ store.on('update', this.storesDidUpdate);
+ }, this);
+ if (props.componentDidMount) props.componentDidMount.call(this);
+ };
+ this.componentWillUnmount = function () {
+ componentStores.forEach(function (store) {
+ store.removeListener('update', this.storesDidUpdate);
+ }, this);
+ if (props.componentWillUnmount) props.componentWillUnmount.call(this);
+ };
+
+ }
+ }
+}
+
+module.exports = ExtendedComponent;
+}).call(this,require('_process'))
+},{"_process":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/browserify/node_modules/process/browser.js"}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/flux-react/app/main.js":[function(require,module,exports){
+var React = require('react');
+var ReactDispatcher = require('react-flux-dispatcher');
+var ReactStore = require('react-flux-store');
+var merge = require('react/lib/merge');
+
+var ExtendedComponent = require('./ExtendedComponent.js');
+var dispatcher = new ReactDispatcher();
+
+React.debug = function () {
+ window.React = React;
+};
+
+var createClass = React.createClass;
+React.createClass = function (props) {
+ var componentClass = merge(props, new ExtendedComponent(dispatcher, props));
+ return createClass.call(React, componentClass);
+};
+
+React.createStore = function (props) {
+ props = props || {};
+ return ReactStore.create(dispatcher, props);
+};
+
+React.dispatch = dispatcher.dispatch.bind(dispatcher),
+
+module.exports = React;
+},{"./ExtendedComponent.js":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/flux-react/app/ExtendedComponent.js","react":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/react.js","react-flux-dispatcher":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react-flux-dispatcher/app/main.js","react-flux-store":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react-flux-store/app/main.js","react/lib/merge":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/merge.js"}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react-flux-dispatcher/app/compareArraysWithProp.js":[function(require,module,exports){
+'use strict';
+module.exports = function (propA, arrayA, propB, arrayB) {
+
+ for (var x = 0; x < arrayA.length; x++) {
+ var doesExist = false;
+ for (var y = 0; y < arrayB.length; y++) {
+ if ((propA ? arrayA[x][propA] : arrayA[x]) === (propB ? arrayB[y][propB] : arrayB[y])) {
+ doesExist = true;
+ }
+ }
+ if (!doesExist) {
+ return false;
+ }
+ }
+ return true;
+};
+},{}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react-flux-dispatcher/app/isValidDependencyLayout.js":[function(require,module,exports){
+'use strict';
+
+var permute = require('./permute.js');
+var compareArraysWithProp = require('./compareArraysWithProp.js');
+
+module.exports = function (prop, depsLayout) {
+
+ depsLayout = depsLayout.slice(0); // Create copy of array since it will be manipulated
+ var resolvedDeps = [];
+ var maxLoops = permute(depsLayout.length); // Get possible combinations of layout
+ var loops = 0;
+
+ // Optimize layout so that less dependency objects
+ // are handled first
+ depsLayout.sort(function (a, b) {
+ return a.deps.length < b.deps.length;
+ });
+
+ while (depsLayout.length) {
+ if (loops > maxLoops) {
+ return false;
+ }
+ loops++;
+ var depLayout= depsLayout[0];
+ var dependenciesLoaded = compareArraysWithProp(null, depLayout.deps, prop, resolvedDeps);
+ if (!dependenciesLoaded) {
+ depsLayout = depsLayout.concat(depsLayout.splice(0, 1)); // Move first item to end of array
+ continue;
+ }
+ resolvedDeps.push(depLayout);
+ depsLayout.splice(0, 1);
+ }
+ return resolvedDeps;
+};
+},{"./compareArraysWithProp.js":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react-flux-dispatcher/app/compareArraysWithProp.js","./permute.js":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react-flux-dispatcher/app/permute.js"}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react-flux-dispatcher/app/main.js":[function(require,module,exports){
+/*
+ A single instance dispatcher for React JS flux architecture
+*/
+'use strict';
+var Promise = require('es6-promise').Promise;
+var isValidDependencyLayout = require('./isValidDependencyLayout.js');
+var compareArraysWithProp = require('./compareArraysWithProp.js');
+
+var getCallback = function (callbacks, store) {
+ for (var x = 0; x < callbacks.length; x++) {
+ if (callbacks[x].store === store) {
+ return callbacks[x];
+ }
+ }
+};
+
+// A function that creates a waitFor() method for the specific dispatch
+// callback. This is needed to understand what store is depending on what
+// other stores
+var createWaitForMethod = function (store, dispatcher) {
+
+ return function (payload, storeDeps, callback) {
+
+ storeDeps = Array.isArray(storeDeps) ? storeDeps : [storeDeps];
+
+ if (arguments.length < 2) {
+ throw new Error('Missing argument(s) in waitFor()')
+ }
+
+ var isValidStores = compareArraysWithProp(null, storeDeps, 'store', dispatcher.callbacks);
+ if (!isValidStores) {
+ throw new Error('You have passed invalid stores to waitFor()');
+ }
+
+ var registeredCallback = getCallback(dispatcher.callbacks, store);
+ registeredCallback.deps = storeDeps;
+
+ if (isValidDependencyLayout('store', dispatcher.callbacks)) {
+ var selectedPromises = dispatcher.callbacks.map(function(callback, index) {
+ if (storeDeps.indexOf(callback.store) >= 0) {
+ return dispatcher.promises[index];
+ }
+ });
+ return Promise.all(selectedPromises).then(callback.bind(store, payload));
+ } else {
+ throw new Error('There is an infinite loop on your waitFor handling');
+ }
+
+ };
+
+};
+
+// The wrapper ensures that "true" is returned
+// even though the callback returns undefined
+// Is this because of Promise?
+var createWrapper = function (context, callback) {
+ return function (payload, waitFor) {
+ var result = callback.call(context, payload, waitFor);
+ if (result === undefined) {
+ return true;
+ } else {
+ return result;
+ }
+ }
+};
+
+function Dispatcher (stores) {
+ this.callbacks = [];
+ this.promises = [];
+ this.stores = stores;
+}
+
+Dispatcher.prototype = {
+
+ register: function(store, callback) {
+ if (arguments.length < 2 || (typeof store !== null && typeof store !== 'object') || typeof callback !== 'function') {
+ throw new Error('You are passing the wrong arguments to register()');
+ }
+ this.callbacks.push({
+ store: store,
+ func: createWrapper(store, callback),
+ deps: [],
+ waitFor: createWaitForMethod(store, this)
+ });
+ },
+
+ dispatch: function(payload) {
+ var resolves = [];
+ var rejects = [];
+
+ payload = payload || {};
+ // First create array of promises for each callback and
+ // add their respective resolves and rejects to individual arrays
+ // for later reference
+ this.promises = this.callbacks.map(function(callback, i) {
+ return new Promise(function(resolve, reject) {
+ resolves[i] = resolve;
+ rejects[i] = reject;
+ });
+ });
+
+ // Dispatch to callbacks and resolve/reject promises.
+ this.callbacks.forEach(function(callback, i) {
+ // Callback can return an obj, to resolve, or a promise, to chain,
+ // no matter what, resolve or reject the callback-promise. Pass
+ // the returned value or payload by default
+ Promise.resolve(callback.func(payload, callback.waitFor.bind(null, payload))).then(function(returnValue) {
+ resolves[i](returnValue || payload);
+ }, function(err) {
+ new Error('Dispatcher callback unsuccessful');
+ rejects[i](err);
+ });
+ });
+ this.promises = [];
+ }
+};
+
+module.exports = Dispatcher;
+},{"./compareArraysWithProp.js":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react-flux-dispatcher/app/compareArraysWithProp.js","./isValidDependencyLayout.js":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react-flux-dispatcher/app/isValidDependencyLayout.js","es6-promise":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/es6-promise/dist/commonjs/main.js"}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react-flux-dispatcher/app/permute.js":[function(require,module,exports){
+'use strict';
+module.exports = function (subset, total) {
+ if (!total) {
+ total = subset;
+ }
+ var perm = [];
+ for (var x = total; x > total-subset; x--) {
+ perm.push(x);
+ }
+ return perm.reduce(function(previousValue, currentValue){
+ return previousValue * currentValue;
+ });
+};
+},{}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react-flux-store/app/main.js":[function(require,module,exports){
+var EventEmitter = require('events').EventEmitter;
+var merge = require('react/lib/merge');
+var mergeInto = require('react/lib/mergeInto');
+
+var Store = function () {}
+Store.prototype = merge(EventEmitter.prototype, {
+ dispatch: function () {},
+ flush: function () {
+ this.emit('update');
+ }
+});
+Store.create = function (Dispatcher, props) {
+ if (arguments.length < 1 || !Dispatcher.register || !Dispatcher.dispatch) {
+ throw new Error('You have to pass a Dispatcher and optionally an object to merge ');
+ }
+ props = props || {};
+ var store = new Store();
+ mergeInto(store, props);
+ Dispatcher.register(store, store.dispatch.bind(store));
+ return store;
+};
+module.exports = Store;
+},{"events":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/browserify/node_modules/events/events.js","react/lib/merge":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/merge.js","react/lib/mergeInto":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/mergeInto.js"}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/AutoFocusMixin.js":[function(require,module,exports){
+/**
+ * Copyright 2013-2014 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @providesModule AutoFocusMixin
+ * @typechecks static-only
+ */
+
+"use strict";
+
+var focusNode = require("./focusNode");
+
+var AutoFocusMixin = {
+ componentDidMount: function() {
+ if (this.props.autoFocus) {
+ focusNode(this.getDOMNode());
+ }
+ }
+};
+
+module.exports = AutoFocusMixin;
+
+},{"./focusNode":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/focusNode.js"}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/BeforeInputEventPlugin.js":[function(require,module,exports){
+/**
+ * Copyright 2013 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @providesModule BeforeInputEventPlugin
+ * @typechecks static-only
+ */
+
+"use strict";
+
+var EventConstants = require("./EventConstants");
+var EventPropagators = require("./EventPropagators");
+var ExecutionEnvironment = require("./ExecutionEnvironment");
+var SyntheticInputEvent = require("./SyntheticInputEvent");
+
+var keyOf = require("./keyOf");
+
+var canUseTextInputEvent = (
+ ExecutionEnvironment.canUseDOM &&
+ 'TextEvent' in window &&
+ !('documentMode' in document || isPresto())
+);
+
+/**
+ * Opera <= 12 includes TextEvent in window, but does not fire
+ * text input events. Rely on keypress instead.
+ */
+function isPresto() {
+ var opera = window.opera;
+ return (
+ typeof opera === 'object' &&
+ typeof opera.version === 'function' &&
+ parseInt(opera.version(), 10) <= 12
+ );
+}
+
+var SPACEBAR_CODE = 32;
+var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
+
+var topLevelTypes = EventConstants.topLevelTypes;
+
+// Events and their corresponding property names.
+var eventTypes = {
+ beforeInput: {
+ phasedRegistrationNames: {
+ bubbled: keyOf({onBeforeInput: null}),
+ captured: keyOf({onBeforeInputCapture: null})
+ },
+ dependencies: [
+ topLevelTypes.topCompositionEnd,
+ topLevelTypes.topKeyPress,
+ topLevelTypes.topTextInput,
+ topLevelTypes.topPaste
+ ]
+ }
+};
+
+// Track characters inserted via keypress and composition events.
+var fallbackChars = null;
+
+/**
+ * Return whether a native keypress event is assumed to be a command.
+ * This is required because Firefox fires `keypress` events for key commands
+ * (cut, copy, select-all, etc.) even though no character is inserted.
+ */
+function isKeypressCommand(nativeEvent) {
+ return (
+ (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
+ // ctrlKey && altKey is equivalent to AltGr, and is not a command.
+ !(nativeEvent.ctrlKey && nativeEvent.altKey)
+ );
+}
+
+/**
+ * Create an `onBeforeInput` event to match
+ * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
+ *
+ * This event plugin is based on the native `textInput` event
+ * available in Chrome, Safari, Opera, and IE. This event fires after
+ * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
+ *
+ * `beforeInput` is spec'd but not implemented in any browsers, and
+ * the `input` event does not provide any useful information about what has
+ * actually been added, contrary to the spec. Thus, `textInput` is the best
+ * available event to identify the characters that have actually been inserted
+ * into the target node.
+ */
+var BeforeInputEventPlugin = {
+
+ eventTypes: eventTypes,
+
+ /**
+ * @param {string} topLevelType Record from `EventConstants`.
+ * @param {DOMEventTarget} topLevelTarget The listening component root node.
+ * @param {string} topLevelTargetID ID of `topLevelTarget`.
+ * @param {object} nativeEvent Native browser event.
+ * @return {*} An accumulation of synthetic events.
+ * @see {EventPluginHub.extractEvents}
+ */
+ extractEvents: function(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID,
+ nativeEvent) {
+
+ var chars;
+
+ if (canUseTextInputEvent) {
+ switch (topLevelType) {
+ case topLevelTypes.topKeyPress:
+ /**
+ * If native `textInput` events are available, our goal is to make
+ * use of them. However, there is a special case: the spacebar key.
+ * In Webkit, preventing default on a spacebar `textInput` event
+ * cancels character insertion, but it *also* causes the browser
+ * to fall back to its default spacebar behavior of scrolling the
+ * page.
+ *
+ * Tracking at:
+ * https://code.google.com/p/chromium/issues/detail?id=355103
+ *
+ * To avoid this issue, use the keypress event as if no `textInput`
+ * event is available.
+ */
+ var which = nativeEvent.which;
+ if (which !== SPACEBAR_CODE) {
+ return;
+ }
+
+ chars = String.fromCharCode(which);
+ break;
+
+ case topLevelTypes.topTextInput:
+ // Record the characters to be added to the DOM.
+ chars = nativeEvent.data;
+
+ // If it's a spacebar character, assume that we have already handled
+ // it at the keypress level and bail immediately.
+ if (chars === SPACEBAR_CHAR) {
+ return;
+ }
+
+ // Otherwise, carry on.
+ break;
+
+ default:
+ // For other native event types, do nothing.
+ return;
+ }
+ } else {
+ switch (topLevelType) {
+ case topLevelTypes.topPaste:
+ // If a paste event occurs after a keypress, throw out the input
+ // chars. Paste events should not lead to BeforeInput events.
+ fallbackChars = null;
+ break;
+ case topLevelTypes.topKeyPress:
+ /**
+ * As of v27, Firefox may fire keypress events even when no character
+ * will be inserted. A few possibilities:
+ *
+ * - `which` is `0`. Arrow keys, Esc key, etc.
+ *
+ * - `which` is the pressed key code, but no char is available.
+ * Ex: 'AltGr + d` in Polish. There is no modified character for
+ * this key combination and no character is inserted into the
+ * document, but FF fires the keypress for char code `100` anyway.
+ * No `input` event will occur.
+ *
+ * - `which` is the pressed key code, but a command combination is
+ * being used. Ex: `Cmd+C`. No character is inserted, and no
+ * `input` event will occur.
+ */
+ if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
+ fallbackChars = String.fromCharCode(nativeEvent.which);
+ }
+ break;
+ case topLevelTypes.topCompositionEnd:
+ fallbackChars = nativeEvent.data;
+ break;
+ }
+
+ // If no changes have occurred to the fallback string, no relevant
+ // event has fired and we're done.
+ if (fallbackChars === null) {
+ return;
+ }
+
+ chars = fallbackChars;
+ }
+
+ // If no characters are being inserted, no BeforeInput event should
+ // be fired.
+ if (!chars) {
+ return;
+ }
+
+ var event = SyntheticInputEvent.getPooled(
+ eventTypes.beforeInput,
+ topLevelTargetID,
+ nativeEvent
+ );
+
+ event.data = chars;
+ fallbackChars = null;
+ EventPropagators.accumulateTwoPhaseDispatches(event);
+ return event;
+ }
+};
+
+module.exports = BeforeInputEventPlugin;
+
+},{"./EventConstants":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/EventConstants.js","./EventPropagators":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/EventPropagators.js","./ExecutionEnvironment":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/ExecutionEnvironment.js","./SyntheticInputEvent":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/SyntheticInputEvent.js","./keyOf":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/keyOf.js"}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/CSSProperty.js":[function(require,module,exports){
+/**
+ * Copyright 2013-2014 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @providesModule CSSProperty
+ */
+
+"use strict";
+
+/**
+ * CSS properties which accept numbers but are not in units of "px".
+ */
+var isUnitlessNumber = {
+ columnCount: true,
+ fillOpacity: true,
+ flex: true,
+ flexGrow: true,
+ flexShrink: true,
+ fontWeight: true,
+ lineClamp: true,
+ lineHeight: true,
+ opacity: true,
+ order: true,
+ orphans: true,
+ widows: true,
+ zIndex: true,
+ zoom: true
+};
+
+/**
+ * @param {string} prefix vendor-specific prefix, eg: Webkit
+ * @param {string} key style name, eg: transitionDuration
+ * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
+ * WebkitTransitionDuration
+ */
+function prefixKey(prefix, key) {
+ return prefix + key.charAt(0).toUpperCase() + key.substring(1);
+}
+
+/**
+ * Support style names that may come passed in prefixed by adding permutations
+ * of vendor prefixes.
+ */
+var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
+
+// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
+// infinite loop, because it iterates over the newly added props too.
+Object.keys(isUnitlessNumber).forEach(function(prop) {
+ prefixes.forEach(function(prefix) {
+ isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
+ });
+});
+
+/**
+ * Most style properties can be unset by doing .style[prop] = '' but IE8
+ * doesn't like doing that with shorthand properties so for the properties that
+ * IE8 breaks on, which are listed here, we instead unset each of the
+ * individual properties. See http://bugs.jquery.com/ticket/12385.
+ * The 4-value 'clock' properties like margin, padding, border-width seem to
+ * behave without any problems. Curiously, list-style works too without any
+ * special prodding.
+ */
+var shorthandPropertyExpansions = {
+ background: {
+ backgroundImage: true,
+ backgroundPosition: true,
+ backgroundRepeat: true,
+ backgroundColor: true
+ },
+ border: {
+ borderWidth: true,
+ borderStyle: true,
+ borderColor: true
+ },
+ borderBottom: {
+ borderBottomWidth: true,
+ borderBottomStyle: true,
+ borderBottomColor: true
+ },
+ borderLeft: {
+ borderLeftWidth: true,
+ borderLeftStyle: true,
+ borderLeftColor: true
+ },
+ borderRight: {
+ borderRightWidth: true,
+ borderRightStyle: true,
+ borderRightColor: true
+ },
+ borderTop: {
+ borderTopWidth: true,
+ borderTopStyle: true,
+ borderTopColor: true
+ },
+ font: {
+ fontStyle: true,
+ fontVariant: true,
+ fontWeight: true,
+ fontSize: true,
+ lineHeight: true,
+ fontFamily: true
+ }
+};
+
+var CSSProperty = {
+ isUnitlessNumber: isUnitlessNumber,
+ shorthandPropertyExpansions: shorthandPropertyExpansions
+};
+
+module.exports = CSSProperty;
+
+},{}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/CSSPropertyOperations.js":[function(require,module,exports){
+/**
+ * Copyright 2013-2014 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @providesModule CSSPropertyOperations
+ * @typechecks static-only
+ */
+
+"use strict";
+
+var CSSProperty = require("./CSSProperty");
+
+var dangerousStyleValue = require("./dangerousStyleValue");
+var hyphenateStyleName = require("./hyphenateStyleName");
+var memoizeStringOnly = require("./memoizeStringOnly");
+
+var processStyleName = memoizeStringOnly(function(styleName) {
+ return hyphenateStyleName(styleName);
+});
+
+/**
+ * Operations for dealing with CSS properties.
+ */
+var CSSPropertyOperations = {
+
+ /**
+ * Serializes a mapping of style properties for use as inline styles:
+ *
+ * > createMarkupForStyles({width: '200px', height: 0})
+ * "width:200px;height:0;"
+ *
+ * Undefined values are ignored so that declarative programming is easier.
+ * The result should be HTML-escaped before insertion into the DOM.
+ *
+ * @param {object} styles
+ * @return {?string}
+ */
+ createMarkupForStyles: function(styles) {
+ var serialized = '';
+ for (var styleName in styles) {
+ if (!styles.hasOwnProperty(styleName)) {
+ continue;
+ }
+ var styleValue = styles[styleName];
+ if (styleValue != null) {
+ serialized += processStyleName(styleName) + ':';
+ serialized += dangerousStyleValue(styleName, styleValue) + ';';
+ }
+ }
+ return serialized || null;
+ },
+
+ /**
+ * Sets the value for multiple styles on a node. If a value is specified as
+ * '' (empty string), the corresponding style property will be unset.
+ *
+ * @param {DOMElement} node
+ * @param {object} styles
+ */
+ setValueForStyles: function(node, styles) {
+ var style = node.style;
+ for (var styleName in styles) {
+ if (!styles.hasOwnProperty(styleName)) {
+ continue;
+ }
+ var styleValue = dangerousStyleValue(styleName, styles[styleName]);
+ if (styleValue) {
+ style[styleName] = styleValue;
+ } else {
+ var expansion = CSSProperty.shorthandPropertyExpansions[styleName];
+ if (expansion) {
+ // Shorthand property that IE8 won't like unsetting, so unset each
+ // component to placate it
+ for (var individualStyleName in expansion) {
+ style[individualStyleName] = '';
+ }
+ } else {
+ style[styleName] = '';
+ }
+ }
+ }
+ }
+
+};
+
+module.exports = CSSPropertyOperations;
+
+},{"./CSSProperty":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/CSSProperty.js","./dangerousStyleValue":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/dangerousStyleValue.js","./hyphenateStyleName":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/hyphenateStyleName.js","./memoizeStringOnly":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/memoizeStringOnly.js"}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/CallbackQueue.js":[function(require,module,exports){
+(function (process){
+/**
+ * Copyright 2013-2014 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @providesModule CallbackQueue
+ */
+
+"use strict";
+
+var PooledClass = require("./PooledClass");
+
+var invariant = require("./invariant");
+var mixInto = require("./mixInto");
+
+/**
+ * A specialized pseudo-event module to help keep track of components waiting to
+ * be notified when their DOM representations are available for use.
+ *
+ * This implements `PooledClass`, so you should never need to instantiate this.
+ * Instead, use `CallbackQueue.getPooled()`.
+ *
+ * @class ReactMountReady
+ * @implements PooledClass
+ * @internal
+ */
+function CallbackQueue() {
+ this._callbacks = null;
+ this._contexts = null;
+}
+
+mixInto(CallbackQueue, {
+
+ /**
+ * Enqueues a callback to be invoked when `notifyAll` is invoked.
+ *
+ * @param {function} callback Invoked when `notifyAll` is invoked.
+ * @param {?object} context Context to call `callback` with.
+ * @internal
+ */
+ enqueue: function(callback, context) {
+ this._callbacks = this._callbacks || [];
+ this._contexts = this._contexts || [];
+ this._callbacks.push(callback);
+ this._contexts.push(context);
+ },
+
+ /**
+ * Invokes all enqueued callbacks and clears the queue. This is invoked after
+ * the DOM representation of a component has been created or updated.
+ *
+ * @internal
+ */
+ notifyAll: function() {
+ var callbacks = this._callbacks;
+ var contexts = this._contexts;
+ if (callbacks) {
+ ("production" !== process.env.NODE_ENV ? invariant(
+ callbacks.length === contexts.length,
+ "Mismatched list of contexts in callback queue"
+ ) : invariant(callbacks.length === contexts.length));
+ this._callbacks = null;
+ this._contexts = null;
+ for (var i = 0, l = callbacks.length; i < l; i++) {
+ callbacks[i].call(contexts[i]);
+ }
+ callbacks.length = 0;
+ contexts.length = 0;
+ }
+ },
+
+ /**
+ * Resets the internal queue.
+ *
+ * @internal
+ */
+ reset: function() {
+ this._callbacks = null;
+ this._contexts = null;
+ },
+
+ /**
+ * `PooledClass` looks for this.
+ */
+ destructor: function() {
+ this.reset();
+ }
+
+});
+
+PooledClass.addPoolingTo(CallbackQueue);
+
+module.exports = CallbackQueue;
+
+}).call(this,require('_process'))
+},{"./PooledClass":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/PooledClass.js","./invariant":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/invariant.js","./mixInto":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/mixInto.js","_process":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/browserify/node_modules/process/browser.js"}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/ChangeEventPlugin.js":[function(require,module,exports){
+/**
+ * Copyright 2013-2014 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @providesModule ChangeEventPlugin
+ */
+
+"use strict";
+
+var EventConstants = require("./EventConstants");
+var EventPluginHub = require("./EventPluginHub");
+var EventPropagators = require("./EventPropagators");
+var ExecutionEnvironment = require("./ExecutionEnvironment");
+var ReactUpdates = require("./ReactUpdates");
+var SyntheticEvent = require("./SyntheticEvent");
+
+var isEventSupported = require("./isEventSupported");
+var isTextInputElement = require("./isTextInputElement");
+var keyOf = require("./keyOf");
+
+var topLevelTypes = EventConstants.topLevelTypes;
+
+var eventTypes = {
+ change: {
+ phasedRegistrationNames: {
+ bubbled: keyOf({onChange: null}),
+ captured: keyOf({onChangeCapture: null})
+ },
+ dependencies: [
+ topLevelTypes.topBlur,
+ topLevelTypes.topChange,
+ topLevelTypes.topClick,
+ topLevelTypes.topFocus,
+ topLevelTypes.topInput,
+ topLevelTypes.topKeyDown,
+ topLevelTypes.topKeyUp,
+ topLevelTypes.topSelectionChange
+ ]
+ }
+};
+
+/**
+ * For IE shims
+ */
+var activeElement = null;
+var activeElementID = null;
+var activeElementValue = null;
+var activeElementValueProp = null;
+
+/**
+ * SECTION: handle `change` event
+ */
+function shouldUseChangeEvent(elem) {
+ return (
+ elem.nodeName === 'SELECT' ||
+ (elem.nodeName === 'INPUT' && elem.type === 'file')
+ );
+}
+
+var doesChangeEventBubble = false;
+if (ExecutionEnvironment.canUseDOM) {
+ // See `handleChange` comment below
+ doesChangeEventBubble = isEventSupported('change') && (
+ !('documentMode' in document) || document.documentMode > 8
+ );
+}
+
+function manualDispatchChangeEvent(nativeEvent) {
+ var event = SyntheticEvent.getPooled(
+ eventTypes.change,
+ activeElementID,
+ nativeEvent
+ );
+ EventPropagators.accumulateTwoPhaseDispatches(event);
+
+ // If change and propertychange bubbled, we'd just bind to it like all the
+ // other events and have it go through ReactBrowserEventEmitter. Since it
+ // doesn't, we manually listen for the events and so we have to enqueue and
+ // process the abstract event manually.
+ //
+ // Batching is necessary here in order to ensure that all event handlers run
+ // before the next rerender (including event handlers attached to ancestor
+ // elements instead of directly on the input). Without this, controlled
+ // components don't work properly in conjunction with event bubbling because
+ // the component is rerendered and the value reverted before all the event
+ // handlers can run. See https://github.com/facebook/react/issues/708.
+ ReactUpdates.batchedUpdates(runEventInBatch, event);
+}
+
+function runEventInBatch(event) {
+ EventPluginHub.enqueueEvents(event);
+ EventPluginHub.processEventQueue();
+}
+
+function startWatchingForChangeEventIE8(target, targetID) {
+ activeElement = target;
+ activeElementID = targetID;
+ activeElement.attachEvent('onchange', manualDispatchChangeEvent);
+}
+
+function stopWatchingForChangeEventIE8() {
+ if (!activeElement) {
+ return;
+ }
+ activeElement.detachEvent('onchange', manualDispatchChangeEvent);
+ activeElement = null;
+ activeElementID = null;
+}
+
+function getTargetIDForChangeEvent(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID) {
+ if (topLevelType === topLevelTypes.topChange) {
+ return topLevelTargetID;
+ }
+}
+function handleEventsForChangeEventIE8(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID) {
+ if (topLevelType === topLevelTypes.topFocus) {
+ // stopWatching() should be a noop here but we call it just in case we
+ // missed a blur event somehow.
+ stopWatchingForChangeEventIE8();
+ startWatchingForChangeEventIE8(topLevelTarget, topLevelTargetID);
+ } else if (topLevelType === topLevelTypes.topBlur) {
+ stopWatchingForChangeEventIE8();
+ }
+}
+
+
+/**
+ * SECTION: handle `input` event
+ */
+var isInputEventSupported = false;
+if (ExecutionEnvironment.canUseDOM) {
+ // IE9 claims to support the input event but fails to trigger it when
+ // deleting text, so we ignore its input events
+ isInputEventSupported = isEventSupported('input') && (
+ !('documentMode' in document) || document.documentMode > 9
+ );
+}
+
+/**
+ * (For old IE.) Replacement getter/setter for the `value` property that gets
+ * set on the active element.
+ */
+var newValueProp = {
+ get: function() {
+ return activeElementValueProp.get.call(this);
+ },
+ set: function(val) {
+ // Cast to a string so we can do equality checks.
+ activeElementValue = '' + val;
+ activeElementValueProp.set.call(this, val);
+ }
+};
+
+/**
+ * (For old IE.) Starts tracking propertychange events on the passed-in element
+ * and override the value property so that we can distinguish user events from
+ * value changes in JS.
+ */
+function startWatchingForValueChange(target, targetID) {
+ activeElement = target;
+ activeElementID = targetID;
+ activeElementValue = target.value;
+ activeElementValueProp = Object.getOwnPropertyDescriptor(
+ target.constructor.prototype,
+ 'value'
+ );
+
+ Object.defineProperty(activeElement, 'value', newValueProp);
+ activeElement.attachEvent('onpropertychange', handlePropertyChange);
+}
+
+/**
+ * (For old IE.) Removes the event listeners from the currently-tracked element,
+ * if any exists.
+ */
+function stopWatchingForValueChange() {
+ if (!activeElement) {
+ return;
+ }
+
+ // delete restores the original property definition
+ delete activeElement.value;
+ activeElement.detachEvent('onpropertychange', handlePropertyChange);
+
+ activeElement = null;
+ activeElementID = null;
+ activeElementValue = null;
+ activeElementValueProp = null;
+}
+
+/**
+ * (For old IE.) Handles a propertychange event, sending a `change` event if
+ * the value of the active element has changed.
+ */
+function handlePropertyChange(nativeEvent) {
+ if (nativeEvent.propertyName !== 'value') {
+ return;
+ }
+ var value = nativeEvent.srcElement.value;
+ if (value === activeElementValue) {
+ return;
+ }
+ activeElementValue = value;
+
+ manualDispatchChangeEvent(nativeEvent);
+}
+
+/**
+ * If a `change` event should be fired, returns the target's ID.
+ */
+function getTargetIDForInputEvent(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID) {
+ if (topLevelType === topLevelTypes.topInput) {
+ // In modern browsers (i.e., not IE8 or IE9), the input event is exactly
+ // what we want so fall through here and trigger an abstract event
+ return topLevelTargetID;
+ }
+}
+
+// For IE8 and IE9.
+function handleEventsForInputEventIE(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID) {
+ if (topLevelType === topLevelTypes.topFocus) {
+ // In IE8, we can capture almost all .value changes by adding a
+ // propertychange handler and looking for events with propertyName
+ // equal to 'value'
+ // In IE9, propertychange fires for most input events but is buggy and
+ // doesn't fire when text is deleted, but conveniently, selectionchange
+ // appears to fire in all of the remaining cases so we catch those and
+ // forward the event if the value has changed
+ // In either case, we don't want to call the event handler if the value
+ // is changed from JS so we redefine a setter for `.value` that updates
+ // our activeElementValue variable, allowing us to ignore those changes
+ //
+ // stopWatching() should be a noop here but we call it just in case we
+ // missed a blur event somehow.
+ stopWatchingForValueChange();
+ startWatchingForValueChange(topLevelTarget, topLevelTargetID);
+ } else if (topLevelType === topLevelTypes.topBlur) {
+ stopWatchingForValueChange();
+ }
+}
+
+// For IE8 and IE9.
+function getTargetIDForInputEventIE(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID) {
+ if (topLevelType === topLevelTypes.topSelectionChange ||
+ topLevelType === topLevelTypes.topKeyUp ||
+ topLevelType === topLevelTypes.topKeyDown) {
+ // On the selectionchange event, the target is just document which isn't
+ // helpful for us so just check activeElement instead.
+ //
+ // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
+ // propertychange on the first input event after setting `value` from a
+ // script and fires only keydown, keypress, keyup. Catching keyup usually
+ // gets it and catching keydown lets us fire an event for the first
+ // keystroke if user does a key repeat (it'll be a little delayed: right
+ // before the second keystroke). Other input methods (e.g., paste) seem to
+ // fire selectionchange normally.
+ if (activeElement && activeElement.value !== activeElementValue) {
+ activeElementValue = activeElement.value;
+ return activeElementID;
+ }
+ }
+}
+
+
+/**
+ * SECTION: handle `click` event
+ */
+function shouldUseClickEvent(elem) {
+ // Use the `click` event to detect changes to checkbox and radio inputs.
+ // This approach works across all browsers, whereas `change` does not fire
+ // until `blur` in IE8.
+ return (
+ elem.nodeName === 'INPUT' &&
+ (elem.type === 'checkbox' || elem.type === 'radio')
+ );
+}
+
+function getTargetIDForClickEvent(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID) {
+ if (topLevelType === topLevelTypes.topClick) {
+ return topLevelTargetID;
+ }
+}
+
+/**
+ * This plugin creates an `onChange` event that normalizes change events
+ * across form elements. This event fires at a time when it's possible to
+ * change the element's value without seeing a flicker.
+ *
+ * Supported elements are:
+ * - input (see `isTextInputElement`)
+ * - textarea
+ * - select
+ */
+var ChangeEventPlugin = {
+
+ eventTypes: eventTypes,
+
+ /**
+ * @param {string} topLevelType Record from `EventConstants`.
+ * @param {DOMEventTarget} topLevelTarget The listening component root node.
+ * @param {string} topLevelTargetID ID of `topLevelTarget`.
+ * @param {object} nativeEvent Native browser event.
+ * @return {*} An accumulation of synthetic events.
+ * @see {EventPluginHub.extractEvents}
+ */
+ extractEvents: function(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID,
+ nativeEvent) {
+
+ var getTargetIDFunc, handleEventFunc;
+ if (shouldUseChangeEvent(topLevelTarget)) {
+ if (doesChangeEventBubble) {
+ getTargetIDFunc = getTargetIDForChangeEvent;
+ } else {
+ handleEventFunc = handleEventsForChangeEventIE8;
+ }
+ } else if (isTextInputElement(topLevelTarget)) {
+ if (isInputEventSupported) {
+ getTargetIDFunc = getTargetIDForInputEvent;
+ } else {
+ getTargetIDFunc = getTargetIDForInputEventIE;
+ handleEventFunc = handleEventsForInputEventIE;
+ }
+ } else if (shouldUseClickEvent(topLevelTarget)) {
+ getTargetIDFunc = getTargetIDForClickEvent;
+ }
+
+ if (getTargetIDFunc) {
+ var targetID = getTargetIDFunc(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID
+ );
+ if (targetID) {
+ var event = SyntheticEvent.getPooled(
+ eventTypes.change,
+ targetID,
+ nativeEvent
+ );
+ EventPropagators.accumulateTwoPhaseDispatches(event);
+ return event;
+ }
+ }
+
+ if (handleEventFunc) {
+ handleEventFunc(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID
+ );
+ }
+ }
+
+};
+
+module.exports = ChangeEventPlugin;
+
+},{"./EventConstants":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/EventConstants.js","./EventPluginHub":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/EventPluginHub.js","./EventPropagators":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/EventPropagators.js","./ExecutionEnvironment":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/ExecutionEnvironment.js","./ReactUpdates":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/ReactUpdates.js","./SyntheticEvent":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/SyntheticEvent.js","./isEventSupported":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/isEventSupported.js","./isTextInputElement":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/isTextInputElement.js","./keyOf":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/keyOf.js"}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/ClientReactRootIndex.js":[function(require,module,exports){
+/**
+ * Copyright 2013-2014 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @providesModule ClientReactRootIndex
+ * @typechecks
+ */
+
+"use strict";
+
+var nextReactRootIndex = 0;
+
+var ClientReactRootIndex = {
+ createReactRootIndex: function() {
+ return nextReactRootIndex++;
+ }
+};
+
+module.exports = ClientReactRootIndex;
+
+},{}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/CompositionEventPlugin.js":[function(require,module,exports){
+/**
+ * Copyright 2013-2014 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @providesModule CompositionEventPlugin
+ * @typechecks static-only
+ */
+
+"use strict";
+
+var EventConstants = require("./EventConstants");
+var EventPropagators = require("./EventPropagators");
+var ExecutionEnvironment = require("./ExecutionEnvironment");
+var ReactInputSelection = require("./ReactInputSelection");
+var SyntheticCompositionEvent = require("./SyntheticCompositionEvent");
+
+var getTextContentAccessor = require("./getTextContentAccessor");
+var keyOf = require("./keyOf");
+
+var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
+var START_KEYCODE = 229;
+
+var useCompositionEvent = (
+ ExecutionEnvironment.canUseDOM &&
+ 'CompositionEvent' in window
+);
+
+// In IE9+, we have access to composition events, but the data supplied
+// by the native compositionend event may be incorrect. In Korean, for example,
+// the compositionend event contains only one character regardless of
+// how many characters have been composed since compositionstart.
+// We therefore use the fallback data while still using the native
+// events as triggers.
+var useFallbackData = (
+ !useCompositionEvent ||
+ (
+ 'documentMode' in document &&
+ document.documentMode > 8 &&
+ document.documentMode <= 11
+ )
+);
+
+var topLevelTypes = EventConstants.topLevelTypes;
+var currentComposition = null;
+
+// Events and their corresponding property names.
+var eventTypes = {
+ compositionEnd: {
+ phasedRegistrationNames: {
+ bubbled: keyOf({onCompositionEnd: null}),
+ captured: keyOf({onCompositionEndCapture: null})
+ },
+ dependencies: [
+ topLevelTypes.topBlur,
+ topLevelTypes.topCompositionEnd,
+ topLevelTypes.topKeyDown,
+ topLevelTypes.topKeyPress,
+ topLevelTypes.topKeyUp,
+ topLevelTypes.topMouseDown
+ ]
+ },
+ compositionStart: {
+ phasedRegistrationNames: {
+ bubbled: keyOf({onCompositionStart: null}),
+ captured: keyOf({onCompositionStartCapture: null})
+ },
+ dependencies: [
+ topLevelTypes.topBlur,
+ topLevelTypes.topCompositionStart,
+ topLevelTypes.topKeyDown,
+ topLevelTypes.topKeyPress,
+ topLevelTypes.topKeyUp,
+ topLevelTypes.topMouseDown
+ ]
+ },
+ compositionUpdate: {
+ phasedRegistrationNames: {
+ bubbled: keyOf({onCompositionUpdate: null}),
+ captured: keyOf({onCompositionUpdateCapture: null})
+ },
+ dependencies: [
+ topLevelTypes.topBlur,
+ topLevelTypes.topCompositionUpdate,
+ topLevelTypes.topKeyDown,
+ topLevelTypes.topKeyPress,
+ topLevelTypes.topKeyUp,
+ topLevelTypes.topMouseDown
+ ]
+ }
+};
+
+/**
+ * Translate native top level events into event types.
+ *
+ * @param {string} topLevelType
+ * @return {object}
+ */
+function getCompositionEventType(topLevelType) {
+ switch (topLevelType) {
+ case topLevelTypes.topCompositionStart:
+ return eventTypes.compositionStart;
+ case topLevelTypes.topCompositionEnd:
+ return eventTypes.compositionEnd;
+ case topLevelTypes.topCompositionUpdate:
+ return eventTypes.compositionUpdate;
+ }
+}
+
+/**
+ * Does our fallback best-guess model think this event signifies that
+ * composition has begun?
+ *
+ * @param {string} topLevelType
+ * @param {object} nativeEvent
+ * @return {boolean}
+ */
+function isFallbackStart(topLevelType, nativeEvent) {
+ return (
+ topLevelType === topLevelTypes.topKeyDown &&
+ nativeEvent.keyCode === START_KEYCODE
+ );
+}
+
+/**
+ * Does our fallback mode think that this event is the end of composition?
+ *
+ * @param {string} topLevelType
+ * @param {object} nativeEvent
+ * @return {boolean}
+ */
+function isFallbackEnd(topLevelType, nativeEvent) {
+ switch (topLevelType) {
+ case topLevelTypes.topKeyUp:
+ // Command keys insert or clear IME input.
+ return (END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1);
+ case topLevelTypes.topKeyDown:
+ // Expect IME keyCode on each keydown. If we get any other
+ // code we must have exited earlier.
+ return (nativeEvent.keyCode !== START_KEYCODE);
+ case topLevelTypes.topKeyPress:
+ case topLevelTypes.topMouseDown:
+ case topLevelTypes.topBlur:
+ // Events are not possible without cancelling IME.
+ return true;
+ default:
+ return false;
+ }
+}
+
+/**
+ * Helper class stores information about selection and document state
+ * so we can figure out what changed at a later date.
+ *
+ * @param {DOMEventTarget} root
+ */
+function FallbackCompositionState(root) {
+ this.root = root;
+ this.startSelection = ReactInputSelection.getSelection(root);
+ this.startValue = this.getText();
+}
+
+/**
+ * Get current text of input.
+ *
+ * @return {string}
+ */
+FallbackCompositionState.prototype.getText = function() {
+ return this.root.value || this.root[getTextContentAccessor()];
+};
+
+/**
+ * Text that has changed since the start of composition.
+ *
+ * @return {string}
+ */
+FallbackCompositionState.prototype.getData = function() {
+ var endValue = this.getText();
+ var prefixLength = this.startSelection.start;
+ var suffixLength = this.startValue.length - this.startSelection.end;
+
+ return endValue.substr(
+ prefixLength,
+ endValue.length - suffixLength - prefixLength
+ );
+};
+
+/**
+ * This plugin creates `onCompositionStart`, `onCompositionUpdate` and
+ * `onCompositionEnd` events on inputs, textareas and contentEditable
+ * nodes.
+ */
+var CompositionEventPlugin = {
+
+ eventTypes: eventTypes,
+
+ /**
+ * @param {string} topLevelType Record from `EventConstants`.
+ * @param {DOMEventTarget} topLevelTarget The listening component root node.
+ * @param {string} topLevelTargetID ID of `topLevelTarget`.
+ * @param {object} nativeEvent Native browser event.
+ * @return {*} An accumulation of synthetic events.
+ * @see {EventPluginHub.extractEvents}
+ */
+ extractEvents: function(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID,
+ nativeEvent) {
+
+ var eventType;
+ var data;
+
+ if (useCompositionEvent) {
+ eventType = getCompositionEventType(topLevelType);
+ } else if (!currentComposition) {
+ if (isFallbackStart(topLevelType, nativeEvent)) {
+ eventType = eventTypes.compositionStart;
+ }
+ } else if (isFallbackEnd(topLevelType, nativeEvent)) {
+ eventType = eventTypes.compositionEnd;
+ }
+
+ if (useFallbackData) {
+ // The current composition is stored statically and must not be
+ // overwritten while composition continues.
+ if (!currentComposition && eventType === eventTypes.compositionStart) {
+ currentComposition = new FallbackCompositionState(topLevelTarget);
+ } else if (eventType === eventTypes.compositionEnd) {
+ if (currentComposition) {
+ data = currentComposition.getData();
+ currentComposition = null;
+ }
+ }
+ }
+
+ if (eventType) {
+ var event = SyntheticCompositionEvent.getPooled(
+ eventType,
+ topLevelTargetID,
+ nativeEvent
+ );
+ if (data) {
+ // Inject data generated from fallback path into the synthetic event.
+ // This matches the property of native CompositionEventInterface.
+ event.data = data;
+ }
+ EventPropagators.accumulateTwoPhaseDispatches(event);
+ return event;
+ }
+ }
+};
+
+module.exports = CompositionEventPlugin;
+
+},{"./EventConstants":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/EventConstants.js","./EventPropagators":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/EventPropagators.js","./ExecutionEnvironment":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/ExecutionEnvironment.js","./ReactInputSelection":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/ReactInputSelection.js","./SyntheticCompositionEvent":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/SyntheticCompositionEvent.js","./getTextContentAccessor":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/getTextContentAccessor.js","./keyOf":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/keyOf.js"}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/DOMChildrenOperations.js":[function(require,module,exports){
+(function (process){
+/**
+ * Copyright 2013-2014 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @providesModule DOMChildrenOperations
+ * @typechecks static-only
+ */
+
+"use strict";
+
+var Danger = require("./Danger");
+var ReactMultiChildUpdateTypes = require("./ReactMultiChildUpdateTypes");
+
+var getTextContentAccessor = require("./getTextContentAccessor");
+var invariant = require("./invariant");
+
+/**
+ * The DOM property to use when setting text content.
+ *
+ * @type {string}
+ * @private
+ */
+var textContentAccessor = getTextContentAccessor();
+
+/**
+ * Inserts `childNode` as a child of `parentNode` at the `index`.
+ *
+ * @param {DOMElement} parentNode Parent node in which to insert.
+ * @param {DOMElement} childNode Child node to insert.
+ * @param {number} index Index at which to insert the child.
+ * @internal
+ */
+function insertChildAt(parentNode, childNode, index) {
+ // By exploiting arrays returning `undefined` for an undefined index, we can
+ // rely exclusively on `insertBefore(node, null)` instead of also using
+ // `appendChild(node)`. However, using `undefined` is not allowed by all
+ // browsers so we must replace it with `null`.
+ parentNode.insertBefore(
+ childNode,
+ parentNode.childNodes[index] || null
+ );
+}
+
+var updateTextContent;
+if (textContentAccessor === 'textContent') {
+ /**
+ * Sets the text content of `node` to `text`.
+ *
+ * @param {DOMElement} node Node to change
+ * @param {string} text New text content
+ */
+ updateTextContent = function(node, text) {
+ node.textContent = text;
+ };
+} else {
+ /**
+ * Sets the text content of `node` to `text`.
+ *
+ * @param {DOMElement} node Node to change
+ * @param {string} text New text content
+ */
+ updateTextContent = function(node, text) {
+ // In order to preserve newlines correctly, we can't use .innerText to set
+ // the contents (see #1080), so we empty the element then append a text node
+ while (node.firstChild) {
+ node.removeChild(node.firstChild);
+ }
+ if (text) {
+ var doc = node.ownerDocument || document;
+ node.appendChild(doc.createTextNode(text));
+ }
+ };
+}
+
+/**
+ * Operations for updating with DOM children.
+ */
+var DOMChildrenOperations = {
+
+ dangerouslyReplaceNodeWithMarkup: Danger.dangerouslyReplaceNodeWithMarkup,
+
+ updateTextContent: updateTextContent,
+
+ /**
+ * Updates a component's children by processing a series of updates. The
+ * update configurations are each expected to have a `parentNode` property.
+ *
+ * @param {array} updates List of update configurations.
+ * @param {array} markupList List of markup strings.
+ * @internal
+ */
+ processUpdates: function(updates, markupList) {
+ var update;
+ // Mapping from parent IDs to initial child orderings.
+ var initialChildren = null;
+ // List of children that will be moved or removed.
+ var updatedChildren = null;
+
+ for (var i = 0; update = updates[i]; i++) {
+ if (update.type === ReactMultiChildUpdateTypes.MOVE_EXISTING ||
+ update.type === ReactMultiChildUpdateTypes.REMOVE_NODE) {
+ var updatedIndex = update.fromIndex;
+ var updatedChild = update.parentNode.childNodes[updatedIndex];
+ var parentID = update.parentID;
+
+ ("production" !== process.env.NODE_ENV ? invariant(
+ updatedChild,
+ 'processUpdates(): Unable to find child %s of element. This ' +
+ 'probably means the DOM was unexpectedly mutated (e.g., by the ' +
+ 'browser), usually due to forgetting a when using tables, ' +
+ 'nesting or tags, or using non-SVG elements in an '+
+ 'parent. Try inspecting the child nodes of the element with React ' +
+ 'ID `%s`.',
+ updatedIndex,
+ parentID
+ ) : invariant(updatedChild));
+
+ initialChildren = initialChildren || {};
+ initialChildren[parentID] = initialChildren[parentID] || [];
+ initialChildren[parentID][updatedIndex] = updatedChild;
+
+ updatedChildren = updatedChildren || [];
+ updatedChildren.push(updatedChild);
+ }
+ }
+
+ var renderedMarkup = Danger.dangerouslyRenderMarkup(markupList);
+
+ // Remove updated children first so that `toIndex` is consistent.
+ if (updatedChildren) {
+ for (var j = 0; j < updatedChildren.length; j++) {
+ updatedChildren[j].parentNode.removeChild(updatedChildren[j]);
+ }
+ }
+
+ for (var k = 0; update = updates[k]; k++) {
+ switch (update.type) {
+ case ReactMultiChildUpdateTypes.INSERT_MARKUP:
+ insertChildAt(
+ update.parentNode,
+ renderedMarkup[update.markupIndex],
+ update.toIndex
+ );
+ break;
+ case ReactMultiChildUpdateTypes.MOVE_EXISTING:
+ insertChildAt(
+ update.parentNode,
+ initialChildren[update.parentID][update.fromIndex],
+ update.toIndex
+ );
+ break;
+ case ReactMultiChildUpdateTypes.TEXT_CONTENT:
+ updateTextContent(
+ update.parentNode,
+ update.textContent
+ );
+ break;
+ case ReactMultiChildUpdateTypes.REMOVE_NODE:
+ // Already removed by the for-loop above.
+ break;
+ }
+ }
+ }
+
+};
+
+module.exports = DOMChildrenOperations;
+
+}).call(this,require('_process'))
+},{"./Danger":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/Danger.js","./ReactMultiChildUpdateTypes":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/ReactMultiChildUpdateTypes.js","./getTextContentAccessor":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/getTextContentAccessor.js","./invariant":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/invariant.js","_process":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/browserify/node_modules/process/browser.js"}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/DOMProperty.js":[function(require,module,exports){
+(function (process){
+/**
+ * Copyright 2013-2014 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @providesModule DOMProperty
+ * @typechecks static-only
+ */
+
+/*jslint bitwise: true */
+
+"use strict";
+
+var invariant = require("./invariant");
+
+var DOMPropertyInjection = {
+ /**
+ * Mapping from normalized, camelcased property names to a configuration that
+ * specifies how the associated DOM property should be accessed or rendered.
+ */
+ MUST_USE_ATTRIBUTE: 0x1,
+ MUST_USE_PROPERTY: 0x2,
+ HAS_SIDE_EFFECTS: 0x4,
+ HAS_BOOLEAN_VALUE: 0x8,
+ HAS_NUMERIC_VALUE: 0x10,
+ HAS_POSITIVE_NUMERIC_VALUE: 0x20 | 0x10,
+ HAS_OVERLOADED_BOOLEAN_VALUE: 0x40,
+
+ /**
+ * Inject some specialized knowledge about the DOM. This takes a config object
+ * with the following properties:
+ *
+ * isCustomAttribute: function that given an attribute name will return true
+ * if it can be inserted into the DOM verbatim. Useful for data-* or aria-*
+ * attributes where it's impossible to enumerate all of the possible
+ * attribute names,
+ *
+ * Properties: object mapping DOM property name to one of the
+ * DOMPropertyInjection constants or null. If your attribute isn't in here,
+ * it won't get written to the DOM.
+ *
+ * DOMAttributeNames: object mapping React attribute name to the DOM
+ * attribute name. Attribute names not specified use the **lowercase**
+ * normalized name.
+ *
+ * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.
+ * Property names not specified use the normalized name.
+ *
+ * DOMMutationMethods: Properties that require special mutation methods. If
+ * `value` is undefined, the mutation method should unset the property.
+ *
+ * @param {object} domPropertyConfig the config as described above.
+ */
+ injectDOMPropertyConfig: function(domPropertyConfig) {
+ var Properties = domPropertyConfig.Properties || {};
+ var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
+ var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
+ var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
+
+ if (domPropertyConfig.isCustomAttribute) {
+ DOMProperty._isCustomAttributeFunctions.push(
+ domPropertyConfig.isCustomAttribute
+ );
+ }
+
+ for (var propName in Properties) {
+ ("production" !== process.env.NODE_ENV ? invariant(
+ !DOMProperty.isStandardName.hasOwnProperty(propName),
+ 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property ' +
+ '\'%s\' which has already been injected. You may be accidentally ' +
+ 'injecting the same DOM property config twice, or you may be ' +
+ 'injecting two configs that have conflicting property names.',
+ propName
+ ) : invariant(!DOMProperty.isStandardName.hasOwnProperty(propName)));
+
+ DOMProperty.isStandardName[propName] = true;
+
+ var lowerCased = propName.toLowerCase();
+ DOMProperty.getPossibleStandardName[lowerCased] = propName;
+
+ if (DOMAttributeNames.hasOwnProperty(propName)) {
+ var attributeName = DOMAttributeNames[propName];
+ DOMProperty.getPossibleStandardName[attributeName] = propName;
+ DOMProperty.getAttributeName[propName] = attributeName;
+ } else {
+ DOMProperty.getAttributeName[propName] = lowerCased;
+ }
+
+ DOMProperty.getPropertyName[propName] =
+ DOMPropertyNames.hasOwnProperty(propName) ?
+ DOMPropertyNames[propName] :
+ propName;
+
+ if (DOMMutationMethods.hasOwnProperty(propName)) {
+ DOMProperty.getMutationMethod[propName] = DOMMutationMethods[propName];
+ } else {
+ DOMProperty.getMutationMethod[propName] = null;
+ }
+
+ var propConfig = Properties[propName];
+ DOMProperty.mustUseAttribute[propName] =
+ propConfig & DOMPropertyInjection.MUST_USE_ATTRIBUTE;
+ DOMProperty.mustUseProperty[propName] =
+ propConfig & DOMPropertyInjection.MUST_USE_PROPERTY;
+ DOMProperty.hasSideEffects[propName] =
+ propConfig & DOMPropertyInjection.HAS_SIDE_EFFECTS;
+ DOMProperty.hasBooleanValue[propName] =
+ propConfig & DOMPropertyInjection.HAS_BOOLEAN_VALUE;
+ DOMProperty.hasNumericValue[propName] =
+ propConfig & DOMPropertyInjection.HAS_NUMERIC_VALUE;
+ DOMProperty.hasPositiveNumericValue[propName] =
+ propConfig & DOMPropertyInjection.HAS_POSITIVE_NUMERIC_VALUE;
+ DOMProperty.hasOverloadedBooleanValue[propName] =
+ propConfig & DOMPropertyInjection.HAS_OVERLOADED_BOOLEAN_VALUE;
+
+ ("production" !== process.env.NODE_ENV ? invariant(
+ !DOMProperty.mustUseAttribute[propName] ||
+ !DOMProperty.mustUseProperty[propName],
+ 'DOMProperty: Cannot require using both attribute and property: %s',
+ propName
+ ) : invariant(!DOMProperty.mustUseAttribute[propName] ||
+ !DOMProperty.mustUseProperty[propName]));
+ ("production" !== process.env.NODE_ENV ? invariant(
+ DOMProperty.mustUseProperty[propName] ||
+ !DOMProperty.hasSideEffects[propName],
+ 'DOMProperty: Properties that have side effects must use property: %s',
+ propName
+ ) : invariant(DOMProperty.mustUseProperty[propName] ||
+ !DOMProperty.hasSideEffects[propName]));
+ ("production" !== process.env.NODE_ENV ? invariant(
+ !!DOMProperty.hasBooleanValue[propName] +
+ !!DOMProperty.hasNumericValue[propName] +
+ !!DOMProperty.hasOverloadedBooleanValue[propName] <= 1,
+ 'DOMProperty: Value can be one of boolean, overloaded boolean, or ' +
+ 'numeric value, but not a combination: %s',
+ propName
+ ) : invariant(!!DOMProperty.hasBooleanValue[propName] +
+ !!DOMProperty.hasNumericValue[propName] +
+ !!DOMProperty.hasOverloadedBooleanValue[propName] <= 1));
+ }
+ }
+};
+var defaultValueCache = {};
+
+/**
+ * DOMProperty exports lookup objects that can be used like functions:
+ *
+ * > DOMProperty.isValid['id']
+ * true
+ * > DOMProperty.isValid['foobar']
+ * undefined
+ *
+ * Although this may be confusing, it performs better in general.
+ *
+ * @see http://jsperf.com/key-exists
+ * @see http://jsperf.com/key-missing
+ */
+var DOMProperty = {
+
+ ID_ATTRIBUTE_NAME: 'data-reactid',
+
+ /**
+ * Checks whether a property name is a standard property.
+ * @type {Object}
+ */
+ isStandardName: {},
+
+ /**
+ * Mapping from lowercase property names to the properly cased version, used
+ * to warn in the case of missing properties.
+ * @type {Object}
+ */
+ getPossibleStandardName: {},
+
+ /**
+ * Mapping from normalized names to attribute names that differ. Attribute
+ * names are used when rendering markup or with `*Attribute()`.
+ * @type {Object}
+ */
+ getAttributeName: {},
+
+ /**
+ * Mapping from normalized names to properties on DOM node instances.
+ * (This includes properties that mutate due to external factors.)
+ * @type {Object}
+ */
+ getPropertyName: {},
+
+ /**
+ * Mapping from normalized names to mutation methods. This will only exist if
+ * mutation cannot be set simply by the property or `setAttribute()`.
+ * @type {Object}
+ */
+ getMutationMethod: {},
+
+ /**
+ * Whether the property must be accessed and mutated as an object property.
+ * @type {Object}
+ */
+ mustUseAttribute: {},
+
+ /**
+ * Whether the property must be accessed and mutated using `*Attribute()`.
+ * (This includes anything that fails ` in `.)
+ * @type {Object}
+ */
+ mustUseProperty: {},
+
+ /**
+ * Whether or not setting a value causes side effects such as triggering
+ * resources to be loaded or text selection changes. We must ensure that
+ * the value is only set if it has changed.
+ * @type {Object}
+ */
+ hasSideEffects: {},
+
+ /**
+ * Whether the property should be removed when set to a falsey value.
+ * @type {Object}
+ */
+ hasBooleanValue: {},
+
+ /**
+ * Whether the property must be numeric or parse as a
+ * numeric and should be removed when set to a falsey value.
+ * @type {Object}
+ */
+ hasNumericValue: {},
+
+ /**
+ * Whether the property must be positive numeric or parse as a positive
+ * numeric and should be removed when set to a falsey value.
+ * @type {Object}
+ */
+ hasPositiveNumericValue: {},
+
+ /**
+ * Whether the property can be used as a flag as well as with a value. Removed
+ * when strictly equal to false; present without a value when strictly equal
+ * to true; present with a value otherwise.
+ * @type {Object}
+ */
+ hasOverloadedBooleanValue: {},
+
+ /**
+ * All of the isCustomAttribute() functions that have been injected.
+ */
+ _isCustomAttributeFunctions: [],
+
+ /**
+ * Checks whether a property name is a custom attribute.
+ * @method
+ */
+ isCustomAttribute: function(attributeName) {
+ for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
+ var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
+ if (isCustomAttributeFn(attributeName)) {
+ return true;
+ }
+ }
+ return false;
+ },
+
+ /**
+ * Returns the default property value for a DOM property (i.e., not an
+ * attribute). Most default values are '' or false, but not all. Worse yet,
+ * some (in particular, `type`) vary depending on the type of element.
+ *
+ * TODO: Is it better to grab all the possible properties when creating an
+ * element to avoid having to create the same element twice?
+ */
+ getDefaultValueForProperty: function(nodeName, prop) {
+ var nodeDefaults = defaultValueCache[nodeName];
+ var testElement;
+ if (!nodeDefaults) {
+ defaultValueCache[nodeName] = nodeDefaults = {};
+ }
+ if (!(prop in nodeDefaults)) {
+ testElement = document.createElement(nodeName);
+ nodeDefaults[prop] = testElement[prop];
+ }
+ return nodeDefaults[prop];
+ },
+
+ injection: DOMPropertyInjection
+};
+
+module.exports = DOMProperty;
+
+}).call(this,require('_process'))
+},{"./invariant":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/invariant.js","_process":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/browserify/node_modules/process/browser.js"}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/DOMPropertyOperations.js":[function(require,module,exports){
+(function (process){
+/**
+ * Copyright 2013-2014 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @providesModule DOMPropertyOperations
+ * @typechecks static-only
+ */
+
+"use strict";
+
+var DOMProperty = require("./DOMProperty");
+
+var escapeTextForBrowser = require("./escapeTextForBrowser");
+var memoizeStringOnly = require("./memoizeStringOnly");
+var warning = require("./warning");
+
+function shouldIgnoreValue(name, value) {
+ return value == null ||
+ (DOMProperty.hasBooleanValue[name] && !value) ||
+ (DOMProperty.hasNumericValue[name] && isNaN(value)) ||
+ (DOMProperty.hasPositiveNumericValue[name] && (value < 1)) ||
+ (DOMProperty.hasOverloadedBooleanValue[name] && value === false);
+}
+
+var processAttributeNameAndPrefix = memoizeStringOnly(function(name) {
+ return escapeTextForBrowser(name) + '="';
+});
+
+if ("production" !== process.env.NODE_ENV) {
+ var reactProps = {
+ children: true,
+ dangerouslySetInnerHTML: true,
+ key: true,
+ ref: true
+ };
+ var warnedProperties = {};
+
+ var warnUnknownProperty = function(name) {
+ if (reactProps.hasOwnProperty(name) && reactProps[name] ||
+ warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
+ return;
+ }
+
+ warnedProperties[name] = true;
+ var lowerCasedName = name.toLowerCase();
+
+ // data-* attributes should be lowercase; suggest the lowercase version
+ var standardName = (
+ DOMProperty.isCustomAttribute(lowerCasedName) ?
+ lowerCasedName :
+ DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ?
+ DOMProperty.getPossibleStandardName[lowerCasedName] :
+ null
+ );
+
+ // For now, only warn when we have a suggested correction. This prevents
+ // logging too much when using transferPropsTo.
+ ("production" !== process.env.NODE_ENV ? warning(
+ standardName == null,
+ 'Unknown DOM property ' + name + '. Did you mean ' + standardName + '?'
+ ) : null);
+
+ };
+}
+
+/**
+ * Operations for dealing with DOM properties.
+ */
+var DOMPropertyOperations = {
+
+ /**
+ * Creates markup for the ID property.
+ *
+ * @param {string} id Unescaped ID.
+ * @return {string} Markup string.
+ */
+ createMarkupForID: function(id) {
+ return processAttributeNameAndPrefix(DOMProperty.ID_ATTRIBUTE_NAME) +
+ escapeTextForBrowser(id) + '"';
+ },
+
+ /**
+ * Creates markup for a property.
+ *
+ * @param {string} name
+ * @param {*} value
+ * @return {?string} Markup string, or null if the property was invalid.
+ */
+ createMarkupForProperty: function(name, value) {
+ if (DOMProperty.isStandardName.hasOwnProperty(name) &&
+ DOMProperty.isStandardName[name]) {
+ if (shouldIgnoreValue(name, value)) {
+ return '';
+ }
+ var attributeName = DOMProperty.getAttributeName[name];
+ if (DOMProperty.hasBooleanValue[name] ||
+ (DOMProperty.hasOverloadedBooleanValue[name] && value === true)) {
+ return escapeTextForBrowser(attributeName);
+ }
+ return processAttributeNameAndPrefix(attributeName) +
+ escapeTextForBrowser(value) + '"';
+ } else if (DOMProperty.isCustomAttribute(name)) {
+ if (value == null) {
+ return '';
+ }
+ return processAttributeNameAndPrefix(name) +
+ escapeTextForBrowser(value) + '"';
+ } else if ("production" !== process.env.NODE_ENV) {
+ warnUnknownProperty(name);
+ }
+ return null;
+ },
+
+ /**
+ * Sets the value for a property on a node.
+ *
+ * @param {DOMElement} node
+ * @param {string} name
+ * @param {*} value
+ */
+ setValueForProperty: function(node, name, value) {
+ if (DOMProperty.isStandardName.hasOwnProperty(name) &&
+ DOMProperty.isStandardName[name]) {
+ var mutationMethod = DOMProperty.getMutationMethod[name];
+ if (mutationMethod) {
+ mutationMethod(node, value);
+ } else if (shouldIgnoreValue(name, value)) {
+ this.deleteValueForProperty(node, name);
+ } else if (DOMProperty.mustUseAttribute[name]) {
+ node.setAttribute(DOMProperty.getAttributeName[name], '' + value);
+ } else {
+ var propName = DOMProperty.getPropertyName[name];
+ if (!DOMProperty.hasSideEffects[name] || node[propName] !== value) {
+ node[propName] = value;
+ }
+ }
+ } else if (DOMProperty.isCustomAttribute(name)) {
+ if (value == null) {
+ node.removeAttribute(name);
+ } else {
+ node.setAttribute(name, '' + value);
+ }
+ } else if ("production" !== process.env.NODE_ENV) {
+ warnUnknownProperty(name);
+ }
+ },
+
+ /**
+ * Deletes the value for a property on a node.
+ *
+ * @param {DOMElement} node
+ * @param {string} name
+ */
+ deleteValueForProperty: function(node, name) {
+ if (DOMProperty.isStandardName.hasOwnProperty(name) &&
+ DOMProperty.isStandardName[name]) {
+ var mutationMethod = DOMProperty.getMutationMethod[name];
+ if (mutationMethod) {
+ mutationMethod(node, undefined);
+ } else if (DOMProperty.mustUseAttribute[name]) {
+ node.removeAttribute(DOMProperty.getAttributeName[name]);
+ } else {
+ var propName = DOMProperty.getPropertyName[name];
+ var defaultValue = DOMProperty.getDefaultValueForProperty(
+ node.nodeName,
+ propName
+ );
+ if (!DOMProperty.hasSideEffects[name] ||
+ node[propName] !== defaultValue) {
+ node[propName] = defaultValue;
+ }
+ }
+ } else if (DOMProperty.isCustomAttribute(name)) {
+ node.removeAttribute(name);
+ } else if ("production" !== process.env.NODE_ENV) {
+ warnUnknownProperty(name);
+ }
+ }
+
+};
+
+module.exports = DOMPropertyOperations;
+
+}).call(this,require('_process'))
+},{"./DOMProperty":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/DOMProperty.js","./escapeTextForBrowser":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/escapeTextForBrowser.js","./memoizeStringOnly":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/memoizeStringOnly.js","./warning":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/warning.js","_process":"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/browserify/node_modules/process/browser.js"}],"/Users/christianalfoni/Documents/dev/flux-react-boilerplate/node_modules/react/lib/Danger.js":[function(require,module,exports){
+(function (process){
+/**
+ * Copyright 2013-2014 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @providesModule Danger
+ * @typechecks static-only
+ */
+
+/*jslint evil: true, sub: true */
+
+"use strict";
+
+var ExecutionEnvironment = require("./ExecutionEnvironment");
+
+var createNodesFromMarkup = require("./createNodesFromMarkup");
+var emptyFunction = require("./emptyFunction");
+var getMarkupWrap = require("./getMarkupWrap");
+var invariant = require("./invariant");
+
+var OPEN_TAG_NAME_EXP = /^(<[^ \/>]+)/;
+var RESULT_INDEX_ATTR = 'data-danger-index';
+
+/**
+ * Extracts the `nodeName` from a string of markup.
+ *
+ * NOTE: Extracting the `nodeName` does not require a regular expression match
+ * because we make assumptions about React-generated markup (i.e. there are no
+ * spaces surrounding the opening tag and there is at least one attribute).
+ *
+ * @param {string} markup String of markup.
+ * @return {string} Node name of the supplied markup.
+ * @see http://jsperf.com/extract-nodename
+ */
+function getNodeName(markup) {
+ return markup.substring(1, markup.indexOf(' '));
+}
+
+var Danger = {
+
+ /**
+ * Renders markup into an array of nodes. The markup is expected to render
+ * into a list of root nodes. Also, the length of `resultList` and
+ * `markupList` should be the same.
+ *
+ * @param {array} markupList List of markup strings to render.
+ * @return {array} List of rendered nodes.
+ * @internal
+ */
+ dangerouslyRenderMarkup: function(markupList) {
+ ("production" !== process.env.NODE_ENV ? invariant(
+ ExecutionEnvironment.canUseDOM,
+ 'dangerouslyRenderMarkup(...): Cannot render markup in a Worker ' +
+ 'thread. This is likely a bug in the framework. Please report ' +
+ 'immediately.'
+ ) : invariant(ExecutionEnvironment.canUseDOM));
+ var nodeName;
+ var markupByNodeName = {};
+ // Group markup by `nodeName` if a wrap is necessary, else by '*'.
+ for (var i = 0; i < markupList.length; i++) {
+ ("production" !== process.env.NODE_ENV ? invariant(
+ markupList[i],
+ 'dangerouslyRenderMarkup(...): Missing markup.'
+ ) : invariant(markupList[i]));
+ nodeName = getNodeName(markupList[i]);
+ nodeName = getMarkupWrap(nodeName) ? nodeName : '*';
+ markupByNodeName[nodeName] = markupByNodeName[nodeName] || [];
+ markupByNodeName[nodeName][i] = markupList[i];
+ }
+ var resultList = [];
+ var resultListAssignmentCount = 0;
+ for (nodeName in markupByNodeName) {
+ if (!markupByNodeName.hasOwnProperty(nodeName)) {
+ continue;
+ }
+ var markupListByNodeName = markupByNodeName[nodeName];
+
+ // This for-in loop skips the holes of the sparse array. The order of
+ // iteration should follow the order of assignment, which happens to match
+ // numerical index order, but we don't rely on that.
+ for (var resultIndex in markupListByNodeName) {
+ if (markupListByNodeName.hasOwnProperty(resultIndex)) {
+ var markup = markupListByNodeName[resultIndex];
+
+ // Push the requested markup with an additional RESULT_INDEX_ATTR
+ // attribute. If the markup does not start with a < character, it
+ // will be discarded below (with an appropriate console.error).
+ markupListByNodeName[resultIndex] = markup.replace(
+ OPEN_TAG_NAME_EXP,
+ // This index will be parsed back out below.
+ '$1 ' + RESULT_INDEX_ATTR + '="' + resultIndex + '" '
+ );
+ }
+ }
+
+ // Render each group of markup with similar wrapping `nodeName`.
+ var renderNodes = createNodesFromMarkup(
+ markupListByNodeName.join(''),
+ emptyFunction // Do nothing special with
+
+
+
+
+
+
+
+
+
+
+
+