Permalink
...
Comparing changes
Open a pull request
- 17 commits
- 11 files changed
- 0 commit comments
- 5 contributors
Commits on Oct 17, 2013
|
|
jashkenas |
541c3e6
|
|||
|
|
jashkenas |
11c908a
|
Commits on Dec 31, 2013
|
|
nwwells |
74cf53d
|
|||
|
|
jashkenas |
f3290aa
|
Commits on Jan 07, 2014
|
|
akre54 |
1b030f3
|
|||
|
|
jashkenas |
237486b
|
Commits on Jan 16, 2014
|
|
jashkenas |
3be62f1
|
|||
|
|
jashkenas |
4755dab
|
Commits on Feb 13, 2014
|
|
jashkenas |
05f12d9
|
Commits on Feb 14, 2014
|
|
jashkenas |
f1479e6
|
Commits on Feb 16, 2014
|
|
akre54 |
494e021
|
|||
|
|
sunkibaek |
ae288fa
|
|||
|
|
akre54 |
e4890b8
|
Commits on Feb 20, 2014
|
|
braddunbar |
5b49aae
|
|||
|
|
jashkenas |
07f6079
|
|||
|
|
jashkenas |
01f7f9b
|
|||
|
|
jashkenas |
53f7790
|
Unified
Split
Showing
with
195 additions
and 115 deletions.
- +1 −1 backbone-min.js
- +1 −1 backbone-min.map
- +6 −7 backbone.js
- +1 −1 bower.json
- +1 −1 component.json
- +6 −7 docs/backbone.html
- +25 −9 index.html
- +1 −1 package.json
- +16 −1 test/router.js
- +0 −5 test/test-amd.html
- +137 −81 test/vendor/underscore.js
View
13
backbone.js
| @@ -1,4 +1,4 @@ | ||
| -// 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; | ||
| }, | ||
View
2
bower.json
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "name" : "backbone", | ||
| - "version" : "1.1.1", | ||
| + "version" : "1.1.2", | ||
| "main" : "backbone.js", | ||
| "dependencies" : { | ||
| "underscore" : ">=1.5.0" | ||
View
2
component.json
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "name" : "backbone", | ||
| - "version" : "1.1.1", | ||
| + "version" : "1.1.2", | ||
| "description" : "Give your JS App some Backbone with Models, Views, Collections, and Events.", | ||
| "keywords" : ["model", "view", "controller", "router", "server", "client", "browser"], | ||
| "repo" : "jashkenas/backbone", | ||
View
13
docs/backbone.html
| @@ -27,7 +27,7 @@ | ||
| <div class="pilwrap "> | ||
| <a class="pilcrow" href="#section-1">¶</a> | ||
| </div> | ||
| - <pre><code>Backbone.js <span class="hljs-number">1.1</span><span class="hljs-number">.1</span> | ||
| + <pre><code>Backbone.js <span class="hljs-number">1.1</span><span class="hljs-number">.2</span> | ||
| </code></pre> | ||
| </div> | ||
| @@ -97,9 +97,8 @@ | ||
| </div> | ||
| <div class="content"><div class='highlight'><pre> } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (<span class="hljs-keyword">typeof</span> exports !== <span class="hljs-string">'undefined'</span>) { | ||
| - <span class="hljs-keyword">var</span> _ = <span class="hljs-built_in">require</span>(<span class="hljs-string">'underscore'</span>), $; | ||
| - <span class="hljs-keyword">try</span> { $ = <span class="hljs-built_in">require</span>(<span class="hljs-string">'jquery'</span>); } <span class="hljs-keyword">catch</span>(e) {} | ||
| - factory(root, exports, _, $);</pre></div></div> | ||
| + <span class="hljs-keyword">var</span> _ = <span class="hljs-built_in">require</span>(<span class="hljs-string">'underscore'</span>); | ||
| + factory(root, exports, _);</pre></div></div> | ||
| </li> | ||
| @@ -192,7 +191,7 @@ <h2 id="initial-setup">Initial Setup</h2> | ||
| </div> | ||
| - <div class="content"><div class='highlight'><pre> Backbone.VERSION = <span class="hljs-string">'1.1.1'</span>;</pre></div></div> | ||
| + <div class="content"><div class='highlight'><pre> Backbone.VERSION = <span class="hljs-string">'1.1.2'</span>;</pre></div></div> | ||
| </li> | ||
| @@ -3270,7 +3269,7 @@ <h2 id="backbone-router">Backbone.Router</h2> | ||
| <span class="hljs-keyword">return</span> optional ? match : <span class="hljs-string">'([^/?]+)'</span>; | ||
| }) | ||
| .replace(splatParam, <span class="hljs-string">'([^?]*?)'</span>); | ||
| - <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">RegExp</span>(<span class="hljs-string">'^'</span> + route + <span class="hljs-string">'(?:\\?(.*))?$'</span>); | ||
| + <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">RegExp</span>(<span class="hljs-string">'^'</span> + route + <span class="hljs-string">'(?:\\?([\\s\\S]*))?$'</span>); | ||
| },</pre></div></div> | ||
| </li> | ||
| @@ -3751,7 +3750,7 @@ <h2 id="backbone-history">Backbone.History</h2> | ||
| <div class="content"><div class='highlight'><pre> stop: <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">()</span> {</span> | ||
| Backbone.$(window).off(<span class="hljs-string">'popstate'</span>, <span class="hljs-keyword">this</span>.checkUrl).off(<span class="hljs-string">'hashchange'</span>, <span class="hljs-keyword">this</span>.checkUrl); | ||
| - clearInterval(<span class="hljs-keyword">this</span>._checkUrlInterval); | ||
| + <span class="hljs-keyword">if</span> (<span class="hljs-keyword">this</span>._checkUrlInterval) clearInterval(<span class="hljs-keyword">this</span>._checkUrlInterval); | ||
| History.started = <span class="hljs-literal">false</span>; | ||
| },</pre></div></div> | ||
View
34
index.html
| @@ -285,7 +285,7 @@ | ||
| <div id="sidebar" class="interface"> | ||
| <a class="toc_title" href="#"> | ||
| - Backbone.js <span class="version">(1.1.1)</span> | ||
| + Backbone.js <span class="version">(1.1.2)</span> | ||
| </a> | ||
| <ul class="toc_section"> | ||
| <li>» <a href="http://github.com/jashkenas/backbone">GitHub Repository</a></li> | ||
| @@ -559,11 +559,11 @@ <h2 id="downloads"> | ||
| <table> | ||
| <tr> | ||
| - <td><a class="punch" href="backbone.js">Development Version (1.1.1)</a></td> | ||
| + <td><a class="punch" href="backbone.js">Development Version (1.1.2)</a></td> | ||
| <td class="text"><i>60kb, Full source, tons of comments</i></td> | ||
| </tr> | ||
| <tr> | ||
| - <td><a class="punch" href="backbone-min.js">Production Version (1.1.1)</a></td> | ||
| + <td><a class="punch" href="backbone-min.js">Production Version (1.1.2)</a></td> | ||
| <td class="text" style="line-height: 16px;"> | ||
| <i>6.5kb, Packed and gzipped</i><br /> | ||
| <small>(<a href="backbone-min.map">Source Map</a>)</small> | ||
| @@ -1295,7 +1295,7 @@ <h2 id="Model">Backbone.Model</h2> | ||
| <p> | ||
| <b>save</b> accepts <tt>success</tt> and <tt>error</tt> callbacks in the | ||
| - options hash, which will passed the arguments <tt>(model, response, options)</tt>. | ||
| + options hash, which will be passed the arguments <tt>(model, response, options)</tt>. | ||
| If a server-side validation fails, return a non-<tt>200</tt> | ||
| HTTP response code, along with an error response in text or JSON. | ||
| </p> | ||
| @@ -2355,6 +2355,9 @@ <h2 id="History">Backbone.history</h2> | ||
| When all of your <a href="#Router">Routers</a> have been created, | ||
| and all of the routes are set up properly, call <tt>Backbone.history.start()</tt> | ||
| to begin monitoring <tt>hashchange</tt> events, and dispatching routes. | ||
| + Subsequent calls to <tt>Backbone.history.start()</tt> will throw an error, | ||
| + and <tt>Backbone.History.started</tt> is a boolean value indicating whether | ||
| + it has already been called. | ||
| </p> | ||
| <p> | ||
| @@ -4028,6 +4031,22 @@ <h2 id="examples-tzigla">Tzigla</h2> | ||
| <h2 id="changelog">Change Log</h2> | ||
| + <b class="header">1.1.2</b> — <small><i>Feb. 20, 2014</i></small> | ||
| + — <a href="https://github.com/jashkenas/backbone/compare/1.1.1...1.1.2">Diff</a> | ||
| + — <a href="http://htmlpreview.github.com/?https://raw.github.com/jashkenas/backbone/1.1.2/index.html">Docs</a> | ||
| + <br /> | ||
| + <ul style="margin-top: 5px;"> | ||
| + <li> | ||
| + Backbone no longer tries to require jQuery in Node/CommonJS environments, | ||
| + for better compatibility with folks using Browserify. | ||
| + If you'd like to have Backbone use jQuery from Node, assign it like so: | ||
| + <tt>Backbone.$ = require('jquery');</tt> | ||
| + </li> | ||
| + <li> | ||
| + Bugfix for route parameters with newlines in them. | ||
| + </li> | ||
| + </ul> | ||
| + | ||
| <b class="header">1.1.1</b> — <small><i>Feb. 13, 2014</i></small> — <a href="https://github.com/jashkenas/backbone/compare/1.1.0...1.1.1">Diff</a> — <a href="http://htmlpreview.github.com/?https://raw.github.com/jashkenas/backbone/1.1.1/index.html">Docs</a><br /> | ||
| <ul style="margin-top: 5px;"> | ||
| <li> | ||
| @@ -4056,7 +4075,8 @@ <h2 id="changelog">Change Log</h2> | ||
| </li> | ||
| <li> | ||
| Backbone Views no longer automatically attach options passed to the constructor as | ||
| - <tt>this.options</tt>, but you can do it yourself if you prefer. | ||
| + <tt>this.options</tt> and Backbone Models no longer attach <tt>url</tt> and | ||
| + <tt>urlRoot</tt> options, but you can do it yourself if you prefer. | ||
| </li> | ||
| <li> | ||
| All <tt>"invalid"</tt> events now pass consistent arguments. First the | ||
| @@ -4071,10 +4091,6 @@ <h2 id="changelog">Change Log</h2> | ||
| and vivify incoming nested JSON into associated submodels. | ||
| </li> | ||
| <li> | ||
| - Backbone Models no longer automatically attach the <tt>url</tt> and <tt>urlRoot</tt> | ||
| - options passed to the constructor. | ||
| - </li> | ||
| - <li> | ||
| Many tweaks, optimizations and bugfixes relating to Backbone 1.0, | ||
| including URL overrides, mutation of options, bulk ordering, trailing | ||
| slashes, edge-case listener leaks, nested model parsing... | ||
View
2
package.json
| @@ -19,7 +19,7 @@ | ||
| "lint": "jsl -nofilelisting -nologo -conf docs/jsl.conf -process backbone.js" | ||
| }, | ||
| "main" : "backbone.js", | ||
| - "version" : "1.1.1", | ||
| + "version" : "1.1.2", | ||
| "license" : "MIT", | ||
| "repository": { | ||
| "type": "git", | ||
View
17
test/router.js
| @@ -788,7 +788,22 @@ | ||
| } | ||
| } | ||
| }); | ||
| - var router = new Router; | ||
| + new Router; | ||
| + Backbone.history.start({pushState: true}); | ||
| + }); | ||
| + | ||
| + test('newline in route', 1, function() { | ||
| + location.replace('http://example.com/stuff%0Anonsense?param=foo%0Abar'); | ||
| + Backbone.history.stop(); | ||
| + Backbone.history = _.extend(new Backbone.History, {location: location}); | ||
| + var Router = Backbone.Router.extend({ | ||
| + routes: { | ||
| + 'stuff\nnonsense': function() { | ||
| + ok(true); | ||
| + } | ||
| + } | ||
| + }); | ||
| + new Router; | ||
| Backbone.history.start({pushState: true}); | ||
| }); | ||
View
5
test/test-amd.html
| @@ -16,11 +16,6 @@ | ||
| 'jquery': 'vendor/jquery', | ||
| 'underscore': 'vendor/underscore', | ||
| 'backbone': '../backbone' | ||
| - }, | ||
| - shim: { | ||
| - 'underscore': { | ||
| - exports: '_' | ||
| - } | ||
| } | ||
| }); | ||
Oops, something went wrong.