[Pkg-javascript-commits] [backbone] 12/101: added a rake doc task

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 16:58:24 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.1.0
in repository backbone.

commit 17fc5a24d09ab79528f2b0f89dd8ceb55940c5be
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date:   Sat Oct 2 17:01:47 2010 -0400

    added a rake doc task
---
 Rakefile           |  5 +++++
 docs/backbone.html | 12 +++---------
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/Rakefile b/Rakefile
index 0a9212a..d5c2b96 100644
--- a/Rakefile
+++ b/Rakefile
@@ -5,4 +5,9 @@ desc "rebuild the backbone-min.js files for distribution"
 task :build do
   source = File.read 'backbone.js'
   File.open('backbone-min.js', 'w+') {|f| f.write Closure::Compiler.new.compress(source) }
+end
+
+desc "build the docco documentation"
+task :doc do
+   system "docco backbone.js"
 end
\ No newline at end of file
diff --git a/docs/backbone.html b/docs/backbone.html
index fad94a3..246314c 100644
--- a/docs/backbone.html
+++ b/docs/backbone.html
@@ -28,7 +28,7 @@ for all events.</p>             </td>             <td class="code">
       <span class="kd">var</span> <span class="nx">calls</span><span class="p">;</span>
       <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">ev</span><span class="p">)</span> <span class="p">{</span>
         <span class="k">this</span><span class="p">.</span><span class="nx">_callbacks</span> <span class="o">=</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">calls</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">callbacks</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">calls</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_callbacks</span><span class="p">)</span> <span class="p">{</span>
         <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">callback</span><span class="p">)</span> <span class="p">{</span>
           <span class="nx">calls</span><span class="p">[</span><span class="nx">ev</span><span class="p">]</span> <span class="o">=</span> <span class="p">[];</span>
         <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
@@ -58,7 +58,6 @@ for all events.</p>             </td>             <td class="code">
 If you do not specify the id, a negative id will be assigned for you.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">Backbone</span><span class="p">.</span><span class="nx">Model</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">attributes</span><span class="p">)</span> <span class="p">{</span>
     <span class="k">this</span><span class="p">.</span><span class="nx">_attributes</span> <span class="o">=</span> <span class="p">{};</span>
     <span class="nx">attributes</span> <span class="o">=</span> <span class="nx">attributes</span> <span class="o">||</span> <span class="p">{};</span>
-    <span class="nx">attributes</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">attributes</span><span class="p">.</span><span class="nx">id</span> <span class="o">||</span> <span class="o">-</span><span class="nx">_</span><span class="p">.</span><span class="nx">uniqueId</span><span class="p">();</span>
     <span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="nx">attributes</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
     <span class="k">this</span><span class="p">.</span><span class="nx">cid</span> <span class="o">=</span> <span class="nx">_</span><span class="p">.</span><span class="nx">uniqueId</span><span class="p">(</span><span class="s1">'c'</span><span class="p">);</span>
     <span class="k">this</span><span class="p">.</span><span class="nx">_formerAttributes</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">attributes</span><span class="p">();</span>
@@ -88,7 +87,7 @@ after the last <code>changed</code> event was fired.</p>             </td>
       <span class="k">return</span> <span class="nx">other</span> <span class="o">&&</span> <span class="nx">_</span><span class="p">.</span><span class="nx">isEqual</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">other</span><span class="p">.</span><span class="nx">_attributes</span><span class="p">);</span>
     <span class="p">},</span></pre></div>             </td>           </tr>                               <tr id="section-20">             <td class="docs">               <div class="octowrap">                 <a class="octothorpe" href="#section-20">#</a>               </div>               <p>A model is new if it has never been saved to the server, and has a negative
 ID.</p>             </td>             <td class="code">               <div class="highlight"><pre>    <span class="nx">isNew</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
-      <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">id</span> <span class="o"><</span> <span class="mi">0</span><span class="p">;</span>
+      <span class="k">return</span> <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">id</span><span class="p">;</span>
     <span class="p">},</span></pre></div>             </td>           </tr>                               <tr id="section-21">             <td class="docs">               <div class="octowrap">                 <a class="octothorpe" href="#section-21">#</a>               </div>               <p>Call this method to fire manually fire a <code>changed</code> event for this model.
 Calling this will cause all objects observing the model to update.</p>             </td>             <td class="code">               <div class="highlight"><pre>    <span class="nx">changed</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
       <span class="k">this</span><span class="p">.</span><span class="nx">trigger</span><span class="p">(</span><span class="s1">'change'</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
@@ -123,11 +122,6 @@ choose to silence it.</p>             </td>             <td class="code">
       <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">attrs</span><span class="p">)</span> <span class="k">return</span> <span class="k">this</span><span class="p">;</span>
       <span class="nx">attrs</span> <span class="o">=</span> <span class="nx">attrs</span><span class="p">.</span><span class="nx">_attributes</span> <span class="o">||</span> <span class="nx">attrs</span><span class="p">;</span>
       <span class="kd">var</span> <span class="nx">now</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="k">if</span> <span class="p">(</span><span class="nx">attrs</span><span class="p">.</span><span class="nx">collection</span><span class="p">)</span> <span class="p">{</span>
-        <span class="k">this</span><span class="p">.</span><span class="nx">collection</span> <span class="o">=</span> <span class="nx">attrs</span><span class="p">.</span><span class="nx">collection</span><span class="p">;</span>
-        <span class="k">delete</span> <span class="nx">attrs</span><span class="p">.</span><span class="nx">collection</span><span class="p">;</span>
-        <span class="k">this</span><span class="p">.</span><span class="nx">resource</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">collection</span><span class="p">.</span><span class="nx">resource</span> <span class="o">+</span> <span class="s1">'/'</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">id</span><span class="p">;</span>
-      <span class="p">}</span>
       <span class="k">if</span> <span class="p">(</span><span class="nx">attrs</span><span class="p">.</span><span class="nx">id</span><span class="p">)</span> <span class="p">{</span>
         <span class="k">this</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">attrs</span><span class="p">.</span><span class="nx">id</span><span class="p">;</span>
         <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">collection</span><span class="p">)</span> <span class="k">this</span><span class="p">.</span><span class="nx">resource</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">collection</span><span class="p">.</span><span class="nx">resource</span> <span class="o">+</span> <span class="s1">'/'</span> <span class= [...]
@@ -277,7 +271,7 @@ Sets need to update their indexes when models change ids.</p>             </td>
     <span class="nx">Backbone</span><span class="p">.</span><span class="nx">Collection</span><span class="p">.</span><span class="nx">prototype</span><span class="p">[</span><span class="nx">method</span><span class="p">]</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
       <span class="k">return</span> <span class="nx">_</span><span class="p">[</span><span class="nx">method</span><span class="p">].</span><span class="nx">apply</span><span class="p">(</span><span class="nx">_</span><span class="p">,</span> <span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">models</span><span class="p">].</span><span class="nx">concat</span><span class="p">(</span><span class="nx">_</span><span class="p">.</span><span class="nx" [...]
     <span class="p">};</span>
-  <span class="p">});</span></pre></div>             </td>           </tr>                               <tr id="section-52">             <td class="docs">               <div class="octowrap">                 <a class="octothorpe" href="#section-52">#</a>               </div>               <h2>Backbone View</h2>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">Backbone</span><span class="p">.</span><span class="nx">View</span> < [...]
+  <span class="p">});</span></pre></div>             </td>           </tr>                               <tr id="section-52">             <td class="docs">               <div class="octowrap">                 <a class="octothorpe" href="#section-52">#</a>               </div>               <h2>Backbone.View</h2>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">Backbone</span><span class="p">.</span><span class="nx">View</span> < [...]
     <span class="k">this</span><span class="p">.</span><span class="nx">modes</span> <span class="o">=</span> <span class="p">{};</span>
     <span class="k">this</span><span class="p">.</span><span class="nx">configure</span><span class="p">(</span><span class="nx">options</span> <span class="o">||</span> <span class="p">{});</span>
     <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">options</span><span class="p">.</span><span class="nx">el</span><span class="p">)</span> <span class="p">{</span>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git



More information about the Pkg-javascript-commits mailing list