Skip to content

Commit

Permalink
Backbone.js 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Oct 11, 2013
1 parent 41f815d commit 0a4399e
Show file tree
Hide file tree
Showing 10 changed files with 774 additions and 1,003 deletions.
6 changes: 2 additions & 4 deletions 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.

12 changes: 4 additions & 8 deletions backbone.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Backbone.js 1.0.0
// Backbone.js 1.1.0

// (c) 2010-2011 Jeremy Ashkenas, DocumentCloud Inc.
// (c) 2011-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
Expand Down Expand Up @@ -35,7 +35,7 @@
}

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

// Require Underscore, if we're on the server, and it's not already present.
var _ = root._;
Expand Down Expand Up @@ -761,9 +761,9 @@
}
options.previousModels = this.models;
this._reset();
this.add(models, _.extend({silent: true}, options));
models = this.add(models, _.extend({silent: true}, options));
if (!options.silent) this.trigger('reset', this, options);
return this;
return models;
},

// Add a model to the end of the collection.
Expand Down Expand Up @@ -981,10 +981,6 @@
// having to worry about render order ... and makes it easy for the view to
// react to specific changes in the state of your models.

// Options with special meaning *(e.g. model, collection, id, className)* are
// attached directly to the view. See `viewOptions` for an exhaustive
// list.

// Creating a Backbone.View creates its initial element outside of the DOM,
// if an existing element is not provided...
var View = Backbone.View = function(options) {
Expand Down
1,526 changes: 666 additions & 860 deletions docs/backbone.html

Large diffs are not rendered by default.

56 changes: 18 additions & 38 deletions docs/backbone.localstorage.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ <h1>backbone.localstorage.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-2">&#182;</a>
</div>
<p>AMD. Register as an anonymous module.
</p>
<p>AMD. Register as an anonymous module.</p>

</div>

Expand All @@ -85,8 +84,7 @@ <h1>backbone.localstorage.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-3">&#182;</a>
</div>
<p>Use global variables if the locals are undefined.
</p>
<p>Use global variables if the locals are undefined.</p>

</div>

Expand All @@ -103,8 +101,7 @@ <h1>backbone.localstorage.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-4">&#182;</a>
</div>
<p>RequireJS isn&#39;t being used. Assume underscore and backbone are loaded in <script> tags
</p>
<p>RequireJS isn&#39;t being used. Assume underscore and backbone are loaded in <script> tags</p>

</div>

Expand All @@ -123,15 +120,10 @@ <h1>backbone.localstorage.js</h1>
</div>
<p>A simple module to replace <code>Backbone.sync</code> with <em>localStorage</em>-based
persistence. Models are given GUIDS, and saved into a JSON object. Simple
as that.

</p>
as that.</p>
<p>Hold reference to Underscore.js and Backbone.js in the closure in order
to make things work even if they are removed from the global namespace

</p>
<p>Generate four random hex digits.
</p>
to make things work even if they are removed from the global namespace</p>
<p>Generate four random hex digits.</p>

</div>

Expand All @@ -148,8 +140,7 @@ <h1>backbone.localstorage.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-6">&#182;</a>
</div>
<p>Generate a pseudo-GUID by concatenating random hexadecimal.
</p>
<p>Generate a pseudo-GUID by concatenating random hexadecimal.</p>

</div>

Expand All @@ -168,8 +159,7 @@ <h1>backbone.localstorage.js</h1>
</div>
<p>Our Store is represented by a single JS object in <em>localStorage</em>. Create it
with a meaningful name, like the name you&#39;d give a table.
window.Store is deprectated, use Backbone.LocalStorage instead
</p>
window.Store is deprectated, use Backbone.LocalStorage instead</p>

</div>

Expand All @@ -190,8 +180,7 @@ <h1>backbone.localstorage.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-8">&#182;</a>
</div>
<p>Save the current state of the <strong>Store</strong> to <em>localStorage</em>.
</p>
<p>Save the current state of the <strong>Store</strong> to <em>localStorage</em>.</p>

</div>

Expand All @@ -209,8 +198,7 @@ <h1>backbone.localstorage.js</h1>
<a class="pilcrow" href="#section-9">&#182;</a>
</div>
<p>Add a model, giving it a (hopefully)-unique GUID, if it doesn&#39;t already
have an id of it&#39;s own.
</p>
have an id of it&#39;s own.</p>

</div>

Expand All @@ -234,8 +222,7 @@ <h1>backbone.localstorage.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-10">&#182;</a>
</div>
<p>Update a model by replacing its copy in <code>this.data</code>.
</p>
<p>Update a model by replacing its copy in <code>this.data</code>.</p>

</div>

Expand All @@ -255,8 +242,7 @@ <h1>backbone.localstorage.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-11">&#182;</a>
</div>
<p>Retrieve a model from <code>this.data</code> by id.
</p>
<p>Retrieve a model from <code>this.data</code> by id.</p>

</div>

Expand All @@ -273,8 +259,7 @@ <h1>backbone.localstorage.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-12">&#182;</a>
</div>
<p>Return the array of all models currently in storage.
</p>
<p>Return the array of all models currently in storage.</p>

</div>

Expand All @@ -296,8 +281,7 @@ <h1>backbone.localstorage.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-13">&#182;</a>
</div>
<p>Delete a model from <code>this.data</code>, returning it.
</p>
<p>Delete a model from <code>this.data</code>, returning it.</p>

</div>

Expand Down Expand Up @@ -325,8 +309,7 @@ <h1>backbone.localstorage.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-14">&#182;</a>
</div>
<p>fix for &quot;illegal access&quot; error on Android when JSON.parse is passed null
</p>
<p>fix for &quot;illegal access&quot; error on Android when JSON.parse is passed null</p>

</div>

Expand All @@ -347,8 +330,7 @@ <h1>backbone.localstorage.js</h1>
</div>
<p>localSync delegate to the model or collection&#39;s
<em>localStorage</em> property, which should be an instance of <code>Store</code>.
window.Store.sync and Backbone.localSync is deprectated, use Backbone.LocalStorage.sync instead
</p>
window.Store.sync and Backbone.localSync is deprectated, use Backbone.LocalStorage.sync instead</p>

</div>

Expand Down Expand Up @@ -408,8 +390,7 @@ <h1>backbone.localstorage.js</h1>
<a class="pilcrow" href="#section-16">&#182;</a>
</div>
<p>add compatibility with $.ajax
always execute callback for success and error
</p>
always execute callback for success and error</p>

</div>

Expand Down Expand Up @@ -438,8 +419,7 @@ <h1>backbone.localstorage.js</h1>
<a class="pilcrow" href="#section-17">&#182;</a>
</div>
<p>Override &#39;Backbone.sync&#39; to default to localSync,
the original &#39;Backbone.sync&#39; is still available in &#39;Backbone.ajaxSync&#39;
</p>
the original &#39;Backbone.sync&#39; is still available in &#39;Backbone.ajaxSync&#39;</p>

</div>

Expand Down
10 changes: 1 addition & 9 deletions docs/docco.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,9 @@ b, strong {
font-family: "aller-bold";
}

p {
p, ul, ol {
margin: 15px 0 0px;
}
.annotation ul, .annotation ol {
margin: 25px 0;
}
.annotation ul li, .annotation ol li {
font-size: 14px;
line-height: 18px;
margin: 10px 0;
}

h1, h2, h3, h4, h5, h6 {
color: #112233;
Expand Down
Loading

0 comments on commit 0a4399e

Please sign in to comment.