Skip to content

Commit

Permalink
draft changelog for backbone 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
akre54 committed Sep 25, 2014
1 parent c349965 commit 65f6706
Show file tree
Hide file tree
Showing 10 changed files with 1,147 additions and 757 deletions.
2 changes: 1 addition & 1 deletion backbone-min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion backbone-min.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions backbone.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Backbone.js 1.1.2
// Backbone.js 1.2.0

// (c) 2010-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Backbone may be freely distributed under the MIT license.
Expand Down Expand Up @@ -39,7 +39,7 @@
var slice = array.slice;

// Current version of the library. Keep in sync with `package.json`.
Backbone.VERSION = '1.1.2';
Backbone.VERSION = '1.2.0';

// For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns
// the `$` variable.
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "backbone",
"version" : "1.1.2",
"version" : "1.2.0",
"main" : "backbone.js",
"dependencies" : {
"underscore" : ">=1.5.0"
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "backbone",
"version" : "1.1.2",
"version" : "1.2.0",
"description" : "Give your JS App some Backbone with Models, Views, Collections, and Events.",
"keywords" : ["model", "view", "controller", "router", "server", "client", "browser"],
"repo" : "jashkenas/backbone",
Expand Down
1,713 changes: 1,020 additions & 693 deletions docs/backbone.html

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions docs/backbone.localstorage.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ <h1>backbone.localstorage.js</h1>
*
* https://github.com/jeromegn/Backbone.localStorage
*/</span>
(<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">(root, factory)</span> {</span>
(<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">(root, factory)</span> </span>{
<span class="hljs-keyword">if</span> (<span class="hljs-keyword">typeof</span> define === <span class="hljs-string">"function"</span> &amp;&amp; define.amd) {</pre></div></div>

</li>
Expand All @@ -73,7 +73,7 @@ <h1>backbone.localstorage.js</h1>

</div>

<div class="content"><div class='highlight'><pre> define([<span class="hljs-string">"underscore"</span>,<span class="hljs-string">"backbone"</span>], <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(_, Backbone)</span> {</span></pre></div></div>
<div class="content"><div class='highlight'><pre> define([<span class="hljs-string">"underscore"</span>,<span class="hljs-string">"backbone"</span>], <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(_, Backbone)</span> </span>{</pre></div></div>

</li>

Expand Down Expand Up @@ -107,7 +107,7 @@ <h1>backbone.localstorage.js</h1>

<div class="content"><div class='highlight'><pre> factory(_, Backbone);
}
}(<span class="hljs-keyword">this</span>, <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(_, Backbone)</span> {</span></pre></div></div>
}(<span class="hljs-keyword">this</span>, <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(_, Backbone)</span> </span>{</pre></div></div>

</li>

Expand Down Expand Up @@ -151,7 +151,7 @@ <h1>backbone.localstorage.js</h1>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">S4</span><span class="hljs-params">()</span> {</span>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">S4</span><span class="hljs-params">()</span> </span>{
<span class="hljs-keyword">return</span> (((<span class="hljs-number">1</span>+<span class="hljs-built_in">Math</span>.random())*<span class="hljs-number">0x10000</span>)|<span class="hljs-number">0</span>).toString(<span class="hljs-number">16</span>).substring(<span class="hljs-number">1</span>);
};</pre></div></div>

Expand All @@ -168,7 +168,7 @@ <h1>backbone.localstorage.js</h1>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">guid</span><span class="hljs-params">()</span> {</span>
<div class="content"><div class='highlight'><pre><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">guid</span><span class="hljs-params">()</span> </span>{
<span class="hljs-keyword">return</span> (S4()+S4()+<span class="hljs-string">"-"</span>+S4()+<span class="hljs-string">"-"</span>+S4()+<span class="hljs-string">"-"</span>+S4()+<span class="hljs-string">"-"</span>+S4()+S4()+S4());
};</pre></div></div>

Expand All @@ -187,7 +187,7 @@ <h1>backbone.localstorage.js</h1>

</div>

<div class="content"><div class='highlight'><pre>Backbone.LocalStorage = window.Store = <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(name)</span> {</span>
<div class="content"><div class='highlight'><pre>Backbone.LocalStorage = <span class="hljs-built_in">window</span>.Store = <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(name)</span> </span>{
<span class="hljs-keyword">this</span>.name = name;
<span class="hljs-keyword">var</span> store = <span class="hljs-keyword">this</span>.localStorage().getItem(<span class="hljs-keyword">this</span>.name);
<span class="hljs-keyword">this</span>.records = (store &amp;&amp; store.split(<span class="hljs-string">","</span>)) || [];
Expand All @@ -208,7 +208,7 @@ <h1>backbone.localstorage.js</h1>

</div>

<div class="content"><div class='highlight'><pre> save: <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">()</span> {</span>
<div class="content"><div class='highlight'><pre> save: <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">()</span> </span>{
<span class="hljs-keyword">this</span>.localStorage().setItem(<span class="hljs-keyword">this</span>.name, <span class="hljs-keyword">this</span>.records.join(<span class="hljs-string">","</span>));
},</pre></div></div>

Expand All @@ -226,7 +226,7 @@ <h1>backbone.localstorage.js</h1>

</div>

<div class="content"><div class='highlight'><pre> create: <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(model)</span> {</span>
<div class="content"><div class='highlight'><pre> create: <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(model)</span> </span>{
<span class="hljs-keyword">if</span> (!model.id) {
model.id = guid();
model.set(model.idAttribute, model.id);
Expand All @@ -250,7 +250,7 @@ <h1>backbone.localstorage.js</h1>

</div>

<div class="content"><div class='highlight'><pre> update: <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(model)</span> {</span>
<div class="content"><div class='highlight'><pre> update: <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(model)</span> </span>{
<span class="hljs-keyword">this</span>.localStorage().setItem(<span class="hljs-keyword">this</span>.name+<span class="hljs-string">"-"</span>+model.id, <span class="hljs-built_in">JSON</span>.stringify(model));
<span class="hljs-keyword">if</span> (!_.include(<span class="hljs-keyword">this</span>.records, model.id.toString()))
<span class="hljs-keyword">this</span>.records.push(model.id.toString()); <span class="hljs-keyword">this</span>.save();
Expand All @@ -270,7 +270,7 @@ <h1>backbone.localstorage.js</h1>

</div>

<div class="content"><div class='highlight'><pre> find: <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(model)</span> {</span>
<div class="content"><div class='highlight'><pre> find: <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(model)</span> </span>{
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.jsonData(<span class="hljs-keyword">this</span>.localStorage().getItem(<span class="hljs-keyword">this</span>.name+<span class="hljs-string">"-"</span>+model.id));
},</pre></div></div>

Expand All @@ -287,9 +287,9 @@ <h1>backbone.localstorage.js</h1>

</div>

<div class="content"><div class='highlight'><pre> findAll: <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">()</span> {</span>
<div class="content"><div class='highlight'><pre> findAll: <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">()</span> </span>{
<span class="hljs-keyword">return</span> _(<span class="hljs-keyword">this</span>.records).chain()
.map(<span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(id)</span>{</span>
.map(<span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(id)</span></span>{
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.jsonData(<span class="hljs-keyword">this</span>.localStorage().getItem(<span class="hljs-keyword">this</span>.name+<span class="hljs-string">"-"</span>+id));
}, <span class="hljs-keyword">this</span>)
.compact()
Expand All @@ -309,18 +309,18 @@ <h1>backbone.localstorage.js</h1>

</div>

<div class="content"><div class='highlight'><pre> destroy: <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(model)</span> {</span>
<div class="content"><div class='highlight'><pre> destroy: <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(model)</span> </span>{
<span class="hljs-keyword">if</span> (model.isNew())
<span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>
<span class="hljs-keyword">this</span>.localStorage().removeItem(<span class="hljs-keyword">this</span>.name+<span class="hljs-string">"-"</span>+model.id);
<span class="hljs-keyword">this</span>.records = _.reject(<span class="hljs-keyword">this</span>.records, <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(id)</span>{</span>
<span class="hljs-keyword">this</span>.records = _.reject(<span class="hljs-keyword">this</span>.records, <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(id)</span></span>{
<span class="hljs-keyword">return</span> id === model.id.toString();
});
<span class="hljs-keyword">this</span>.save();
<span class="hljs-keyword">return</span> model;
},

localStorage: <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">()</span> {</span>
localStorage: <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">()</span> </span>{
<span class="hljs-keyword">return</span> localStorage;
},</pre></div></div>

Expand All @@ -337,7 +337,7 @@ <h1>backbone.localstorage.js</h1>

</div>

<div class="content"><div class='highlight'><pre> jsonData: <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">(data)</span> {</span>
<div class="content"><div class='highlight'><pre> jsonData: <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">(data)</span> </span>{
<span class="hljs-keyword">return</span> data &amp;&amp; <span class="hljs-built_in">JSON</span>.parse(data);
}

Expand All @@ -358,7 +358,7 @@ <h1>backbone.localstorage.js</h1>

</div>

<div class="content"><div class='highlight'><pre>Backbone.LocalStorage.sync = window.Store.sync = Backbone.localSync = <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(method, model, options)</span> {</span>
<div class="content"><div class='highlight'><pre>Backbone.LocalStorage.sync = <span class="hljs-built_in">window</span>.Store.sync = Backbone.localSync = <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(method, model, options)</span> </span>{
<span class="hljs-keyword">var</span> store = model.localStorage || model.collection.localStorage;

<span class="hljs-keyword">var</span> resp, errorMessage, syncDfd = $.Deferred &amp;&amp; $.Deferred(); <span class="hljs-comment">//If $ is having Deferred - use it.</span>
Expand All @@ -381,7 +381,7 @@ <h1>backbone.localstorage.js</h1>
}

} <span class="hljs-keyword">catch</span>(error) {
<span class="hljs-keyword">if</span> (error.code === DOMException.QUOTA_EXCEEDED_ERR &amp;&amp; window.localStorage.length === <span class="hljs-number">0</span>)
<span class="hljs-keyword">if</span> (error.code === DOMException.QUOTA_EXCEEDED_ERR &amp;&amp; <span class="hljs-built_in">window</span>.localStorage.length === <span class="hljs-number">0</span>)
errorMessage = <span class="hljs-string">"Private browsing is unsupported"</span>;
<span class="hljs-keyword">else</span>
errorMessage = error.message;
Expand Down Expand Up @@ -425,7 +425,7 @@ <h1>backbone.localstorage.js</h1>

Backbone.ajaxSync = Backbone.sync;

Backbone.getSyncMethod = <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(model)</span> {</span>
Backbone.getSyncMethod = <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(model)</span> </span>{
<span class="hljs-keyword">if</span>(model.localStorage || (model.collection &amp;&amp; model.collection.localStorage)) {
<span class="hljs-keyword">return</span> Backbone.localSync;
}
Expand All @@ -447,7 +447,7 @@ <h1>backbone.localstorage.js</h1>

</div>

<div class="content"><div class='highlight'><pre>Backbone.sync = <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(method, model, options)</span> {</span>
<div class="content"><div class='highlight'><pre>Backbone.sync = <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(method, model, options)</span> </span>{
<span class="hljs-keyword">return</span> Backbone.getSyncMethod(model).apply(<span class="hljs-keyword">this</span>, [method, model, options]);
};

Expand Down
Loading

0 comments on commit 65f6706

Please sign in to comment.