Commit b8ceb317 authored by Sindre Sorhus's avatar Sindre Sorhus

Merge pull request #857 from chenglou/react-bb

[React] New react-backbone todomvc with fixes and React version bump
parents 904aa5a8 bf18ccb5
......@@ -2,11 +2,11 @@
"name": "todomvc-react-backbone",
"version": "0.0.0",
"dependencies": {
"react": "~0.8.0",
"todomvc-common": "~0.1.9",
"backbone": "~1.1.0",
"react": "~0.9.0",
"backbone": "~1.1.2",
"backbone.localstorage": "~1.1.7",
"jquery": "~2.0.3",
"underscore": "~1.5.2"
"jquery": "~2.1.0",
"todomvc-common": "~0.1.9",
"underscore": "~1.6.0"
}
}
// Backbone.js 1.1.1
// Backbone.js 1.1.2
// (c) 2010-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Backbone may be freely distributed under the MIT license.
......@@ -17,9 +17,8 @@
// Next for Node.js or CommonJS. jQuery may not be needed as a module.
} else if (typeof exports !== 'undefined') {
var _ = require('underscore'), $;
try { $ = require('jquery'); } catch(e) {}
factory(root, exports, _, $);
var _ = require('underscore');
factory(root, exports, _);
// Finally, as a browser global.
} else {
......@@ -42,7 +41,7 @@
var splice = array.splice;
// Current version of the library. Keep in sync with `package.json`.
Backbone.VERSION = '1.1.1';
Backbone.VERSION = '1.1.2';
// For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns
// the `$` variable.
......@@ -1293,7 +1292,7 @@
return optional ? match : '([^/?]+)';
})
.replace(splatParam, '([^?]*?)');
return new RegExp('^' + route + '(?:\\?(.*))?$');
return new RegExp('^' + route + '(?:\\?([\\s\\S]*))?$');
},
// Given a route, and a URL fragment that it matches, return the array of
......@@ -1450,7 +1449,7 @@
// but possibly useful for unit testing Routers.
stop: function() {
Backbone.$(window).off('popstate', this.checkUrl).off('hashchange', this.checkUrl);
clearInterval(this._checkUrlInterval);
if (this._checkUrlInterval) clearInterval(this._checkUrlInterval);
History.started = false;
},
......
......@@ -17,7 +17,7 @@
<script src="bower_components/todomvc-common/base.js"></script>
<script src="bower_components/react/react-with-addons.js"></script>
<script src="bower_components/react/JSXTransformer.js"></script>
<script src="bower_components/jquery/jquery.js"></script>
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/underscore/underscore.js"></script>
<script src="bower_components/backbone/backbone.js"></script>
<script src="bower_components/backbone.localStorage/backbone.localStorage.js"></script>
......
......@@ -74,7 +74,6 @@ var app = app || {};
Backbone.history.start();
this.props.todos.fetch();
this.refs.newField.getDOMNode().focus();
},
componentDidUpdate: function () {
......@@ -203,6 +202,7 @@ var app = app || {};
id="new-todo"
placeholder="What needs to be done?"
onKeyDown={this.handleNewTodoKeyDown}
autoFocus={true}
/>
</header>
{main}
......
......@@ -21,7 +21,7 @@ var app = app || {};
<button
id="clear-completed"
onClick={this.props.onClearCompleted}>
{''}Clear completed ({this.props.completedCount}){''}
Clear completed ({this.props.completedCount})
</button>
);
}
......@@ -32,8 +32,7 @@ var app = app || {};
return (
<footer id="footer">
<span id="todo-count">
<strong>{this.props.count}</strong>
{' '}{activeTodoWord}{' '}left{''}
<strong>{this.props.count}</strong> {activeTodoWord} left
</span>
<ul id="filters">
<li>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment