Permalink
Browse files

Added nested routes & resources, cleaned up objects by stuffing more …

…shit in the prototype of each.
  • Loading branch information...
1 parent fa7e1c4 commit 22fd062cf761003a91c69197ae65ab7a77bc06ce @kieran committed Sep 5, 2012
Showing with 1,120 additions and 832 deletions.
  1. +7 −1 docs/docco.css
  2. +2 −2 docs/helpers.html
  3. +39 −47 docs/key.html
  4. +35 −0 docs/resource.html
  5. +195 −163 docs/route.html
  6. +78 −87 docs/router.html
  7. +79 −74 lib/key.js
  8. +36 −0 lib/resource.js
  9. +372 −269 lib/route.js
  10. +193 −183 lib/router.js
  11. +84 −6 tests/barista.test.js
View
@@ -21,6 +21,12 @@ h1, h2, h3, h4, h5, h6 {
h1 {
margin-top: 40px;
}
+hr {
+ border: 0 none;
+ border-top: 1px solid #e5e5ee;
+ height: 1px;
+ margin: 20px 0;
+}
#container {
position: relative;
}
@@ -115,7 +121,7 @@ table td {
}
pre, tt, code {
font-size: 12px; line-height: 18px;
- font-family: Monaco, Consolas, "Lucida Console", monospace;
+ font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace;
margin: 0; padding: 0;
}
View
@@ -1,4 +1,4 @@
-<!DOCTYPE html> <html> <head> <title>helpers.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> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="helpers.html"> helpers.js </a> <a class="source" href="key.html"> key.js </a> <a class="source" href="route.html"> route.js </a> <a class="source" href="router.html"> router.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> helpers.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>CamelCase
+<!DOCTYPE html> <html> <head> <title>helpers.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> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="helpers.html"> helpers.js </a> <a class="source" href="key.html"> key.js </a> <a class="source" href="resource.html"> resource.js </a> <a class="source" href="route.html"> route.js </a> <a class="source" href="router.html"> router.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> helpers.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>CamelCase
var camelize = function(str,capitalize){
var ret = str.replace( /[^a-zA-Z][a-zA-Z]/g, function(str){
return str[1].toUpperCase();
@@ -14,7 +14,7 @@
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>deep object mixer</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">exports</span><span class="p">.</span><span class="nx">mixin</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(){</span>
<span class="kd">var</span> <span class="nx">args</span> <span class="o">=</span> <span class="nb">Array</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">slice</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">arguments</span><span class="p">)</span>
- <span class="k">for</span> <span class="p">(</span> <span class="nx">i</span><span class="o">=</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">args</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span> <span class="p">)</span> <span class="p">{</span>
+ <span class="k">for</span> <span class="p">(</span> <span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">args</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span> <span class="p">)</span> <span class="p">{</span>
<span class="k">for</span> <span class="p">(</span> <span class="kd">var</span> <span class="nx">prop</span> <span class="k">in</span> <span class="nx">args</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span> <span class="nx">exports</span><span class="p">.</span><span class="nx">kindof</span><span class="p">(</span><span class="nx">args</span><span class="p">[</span><span class="nx">i</span><span class="p">][</span><span class="nx">prop</span><span class="p">])</span> <span class="o">==</span> <span class="s1">&#39;object&#39;</span> <span class="p">)</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>deep copy</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">args</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="nx">prop</span><span class="p">]</span> <span class="o">=</span> <span class="nx">mixin</span><span class="p">(</span> <span class="p">{},</span> <span class="nx">args</span><span class="p">[</span><span class="nx">i</span><span class="p">][</span><span class="nx">prop</span><span class="p">]</span> <span class="p">)</span>
Oops, something went wrong.

0 comments on commit 22fd062

Please sign in to comment.