Permalink
Browse files

Updated for v0.4.2

  • Loading branch information...
1 parent 51fd9ea commit b7eab0e2161a667367c81058798d63dbe0ec7d98 @dhruvaray committed Mar 22, 2013
Showing with 1,776 additions and 1,672 deletions.
  1. +5 −2 README.md
  2. +1 −1 backbone-associations.js
  3. +1 −1 component.json
  4. +12 −13 docs/backbone-associations.html
  5. +1 −1 package.json
  6. +567 −471 test/lib/backbone-relational.js
  7. +1,189 −1,183 test/lib/underscore.js
View
@@ -23,8 +23,8 @@ It was originally born out of a need to provide a simpler and speedier implement
## <a name="download"/>Download
-* [Production version - 0.4.1](http://dhruvaray.github.com/backbone-associations/backbone-associations-min.js) (1.44K packed and gzipped)
-* [Development version - 0.4.1](http://dhruvaray.github.com/backbone-associations/backbone-associations.js)
+* [Production version - 0.4.2](http://dhruvaray.github.com/backbone-associations/backbone-associations-min.js) (1.44K packed and gzipped)
+* [Development version - 0.4.2](http://dhruvaray.github.com/backbone-associations/backbone-associations.js)
* [Edge version : ] (https://raw.github.com/dhruvaray/backbone-associations/master/backbone-associations.js)[![Build Status](https://travis-ci.org/dhruvaray/backbone-associations.png?branch=master)](https://travis-ci.org/dhruvaray/backbone-associations)
@@ -576,6 +576,9 @@ Write your own test case [here](http://jsperf.com/backbone-associations-speed-su
## <a name="changelog"/>Change Log
+#### Version 0.4.2 - [Diff](https://github.com/dhruvaray/backbone-associations/compare/v0.4.1...v0.4.2)
+* Support for backbone 1.0.0.
+
#### Version 0.4.1 - [Diff](https://github.com/dhruvaray/backbone-associations/compare/v0.4.0...v0.4.1)
* Support for backbone 0.9.10.
* Faster (Non-recursive) implementation of AssociatedModel change-related methods.
View
@@ -1,5 +1,5 @@
//
-// Backbone-associations.js 0.4.1
+// Backbone-associations.js 0.4.2
//
// (c) 2013 Dhruva Ray, Jaynti Kanani, Persistent Systems Ltd.
// Backbone-associations may be freely distributed under the MIT license.
View
@@ -1,6 +1,6 @@
{
"name":"backbone-associations",
- "version":"0.4.1",
+ "version":"0.4.2",
"main":"./backbone-associations.js",
"dependencies":{
"backbone":"0.9.10",
@@ -1,4 +1,4 @@
-<!DOCTYPE html> <html> <head> <title>backbone-associations.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> backbone-associations.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Backbone-associations.js 0.4.1</p>
+<!DOCTYPE html> <html> <head> <title>backbone-associations.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> backbone-associations.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Backbone-associations.js 0.4.2</p>
<p>(c) 2013 Dhruva Ray, Jaynti Kanani, Persistent Systems Ltd.
Backbone-associations may be freely distributed under the MIT license.
@@ -79,14 +79,9 @@
<span class="nx">data</span> <span class="o">=</span> <span class="nx">val</span><span class="p">;</span>
<span class="nx">attributes</span><span class="p">[</span><span class="nx">relationKey</span><span class="p">]</span> <span class="o">=</span> <span class="nx">data</span><span class="p">;</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
- <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">attributes</span><span class="p">[</span><span class="nx">relationKey</span><span class="p">])</span> <span class="p">{</span>
- <span class="nx">data</span> <span class="o">=</span> <span class="nx">collectionType</span> <span class="o">?</span> <span class="k">new</span> <span class="nx">collectionType</span><span class="p">()</span> <span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_createCollection</span><span class="p">(</span><span class="nx">relatedModel</span><span class="p">);</span>
- <span class="nx">data</span><span class="p">.</span><span class="nx">add</span><span class="p">(</span><span class="nx">val</span><span class="p">,</span> <span class="nx">relationOptions</span><span class="p">);</span>
- <span class="nx">attributes</span><span class="p">[</span><span class="nx">relationKey</span><span class="p">]</span> <span class="o">=</span> <span class="nx">data</span><span class="p">;</span>
- <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
- <span class="k">this</span><span class="p">.</span><span class="nx">attributes</span><span class="p">[</span><span class="nx">relationKey</span><span class="p">].</span><span class="nx">reset</span><span class="p">(</span><span class="nx">val</span><span class="p">,</span> <span class="nx">relationOptions</span><span class="p">);</span>
- <span class="k">delete</span> <span class="nx">attributes</span><span class="p">[</span><span class="nx">relationKey</span><span class="p">];</span>
- <span class="p">}</span>
+ <span class="nx">data</span> <span class="o">=</span> <span class="nx">collectionType</span> <span class="o">?</span> <span class="k">new</span> <span class="nx">collectionType</span><span class="p">()</span> <span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_createCollection</span><span class="p">(</span><span class="nx">relatedModel</span><span class="p">);</span>
+ <span class="nx">data</span><span class="p">.</span><span class="nx">add</span><span class="p">(</span><span class="nx">val</span><span class="p">,</span> <span class="nx">relationOptions</span><span class="p">);</span>
+ <span class="nx">attributes</span><span class="p">[</span><span class="nx">relationKey</span><span class="p">]</span> <span class="o">=</span> <span class="nx">data</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">relation</span><span class="p">.</span><span class="nx">type</span> <span class="o">===</span> <span class="nx">Backbone</span><span class="p">.</span><span class="nx">One</span> <span class="o">&amp;&amp;</span> <span class="nx">relatedModel</span><span class="p">)</span> <span class="p">{</span>
@@ -118,10 +113,14 @@
<span class="nx">initialTokens</span> <span class="o">=</span> <span class="nx">_</span><span class="p">.</span><span class="nx">initial</span><span class="p">(</span><span class="nx">pathTokens</span><span class="p">),</span> <span class="nx">colModel</span><span class="p">;</span>
<span class="nx">colModel</span> <span class="o">=</span> <span class="nx">relationValue</span><span class="p">.</span><span class="nx">find</span><span class="p">(</span><span class="kd">function</span> <span class="p">(</span><span class="nx">model</span><span class="p">)</span> <span class="p">{</span>
- <span class="kd">var</span> <span class="nx">changedModel</span> <span class="o">=</span> <span class="nx">model</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="nx">pathTokens</span><span class="p">);</span>
- <span class="k">return</span> <span class="nx">eventObject</span> <span class="o">===</span> <span class="p">(</span><span class="nx">changedModel</span> <span class="k">instanceof</span> <span class="nx">AssociatedModel</span>
- <span class="o">||</span> <span class="nx">changedModel</span> <span class="k">instanceof</span> <span class="nx">BackboneCollection</span><span class="p">)</span>
- <span class="o">?</span> <span class="nx">changedModel</span> <span class="o">:</span> <span class="p">(</span><span class="nx">model</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="nx">initialTokens</span><span class="p">)</span> <span class="o">||</span> <span class="nx">model</span><span class="p">);</span>
+ <span class="k">if</span> <span class="p">(</span><span class="nx">eventObject</span> <span class="o">===</span> <span class="nx">model</span><span class="p">)</span> <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
+ <span class="k">if</span> <span class="p">(</span><span class="nx">model</span><span class="p">)</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">changedModel</span> <span class="o">=</span> <span class="nx">model</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="nx">initialTokens</span><span class="p">);</span>
+ <span class="k">if</span> <span class="p">((</span><span class="nx">changedModel</span> <span class="k">instanceof</span> <span class="nx">AssociatedModel</span> <span class="o">||</span> <span class="nx">changedModel</span> <span class="k">instanceof</span> <span class="nx">BackboneCollection</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nx">eventObject</span> <span class="o">===</span> <span class="nx">changedModel</span><span class="p">)</span> <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
+ <span class="nx">changedModel</span> <span class="o">=</span> <span class="nx">model</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="nx">pathTokens</span><span class="p">);</span>
+ <span class="k">return</span> <span class="p">((</span><span class="nx">changedModel</span> <span class="k">instanceof</span> <span class="nx">AssociatedModel</span> <span class="o">||</span> <span class="nx">changedModel</span> <span class="k">instanceof</span> <span class="nx">BackboneCollection</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nx">eventObject</span> <span class="o">===</span> <span class="nx">changedModel</span><span class="p">);</span>
+ <span class="p">}</span>
+ <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
<span class="p">});</span>
<span class="nx">colModel</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">indexEventObject</span> <span class="o">=</span> <span class="nx">relationValue</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">colModel</span><span class="p">));</span>
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-29"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-29">&#182;</a> </div> <p>Manipulate <code>eventPath</code>.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">eventPath</span> <span class="o">=</span> <span class="nx">relationKey</span> <span class="o">+</span> <span class="p">(</span><span class="nx">indexEventObject</span> <span class="o">!==</span> <span class="o">-</span><span class="mi">1</span> <span class="o">?</span>
View
@@ -15,5 +15,5 @@
"test":"phantomjs test/lib/runner.js test/test-suite.html?noglobals=true"
},
"main":"backbone-associations.js",
- "version":"0.4.1"
+ "version":"0.4.2"
}
Oops, something went wrong.

0 comments on commit b7eab0e

Please sign in to comment.