This repository has been archived by the owner on Sep 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
010_1_products.html
31 lines (25 loc) · 10.6 KB
/
010_1_products.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!DOCTYPE html> <html> <head> <title>010_1_products.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"></script> <link rel="stylesheet" media="all" href=" http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/ui-lightness/jquery-ui.css" /> <script> $(document).ready(function(){ var coffee_file_array = []; var obj = $('.source'); var arr = $.makeArray(obj); $('.source').each( function(){ coffee_file_array.push($.trim($(this).text()));}); var current_page = $.trim($('title').text()); var number_of_links = $('.source').length; $( "#site_nav" ).text(current_page); for (k in arr){ coffee_file_array.push($.trim(arr[k]['innerText']) ); } console.log(coffee_file_array.indexOf(current_page)); console.log($.inArray(current_page, coffee_file_array)); $( "#slider" ).slider({ range: "min", value: $.inArray(current_page, coffee_file_array), min: 0, max: number_of_links, step: 1, slide: function(ev,ui){ $('#site_nav').text("JumpTo -> "+coffee_file_array[ui.value]).attr('href',coffee_file_array[ui.value].replace('.coffee','.html')); } }); }); </script> </head> <body> <div id="container"> <div id="background"></div> <div id="menu_wrapper" class="grey"> <div class="left"></div> <ul id="menu"> <li><a href="http://jaigouk.github.com/nodetuts-coffeescript">Home</a></li> <li><a href="#" id="site_nav">Navigation</a></li> </ul> </div> <div id="slider"></div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">¶</a> </div> <h1>Express - Part 2</h1>
<hr />
<ul>
<li><a href="http://expressjs.com/">Express</a></li>
<li><a href="https://github.com/visionmedia/express/tree/master/examples">Lots of Exprss examples (github)</a></li>
<li><a href="http://camp.nodejs.org/videos/session-03_routing_workshop-guillermo_rauch.html">Node Camp 2010 Routing Workshop</a> - source codes are little bit old :( </li>
<li><a href="https://github.com/visionmedia/jade">Jade</a> </li>
</ul>
<hr /> </td> <td class="code"> <div class="highlight"><pre><span class="nv">products = </span><span class="p">[</span>
<span class="nv">id: </span><span class="mi">1</span>
<span class="nv">name: </span><span class="s1">'Mac Book Pro'</span>
<span class="nv">description: </span><span class="s1">'Apple 13 inch Mac Book Pro Notebook'</span>
<span class="nv">price: </span><span class="mi">1000</span>
<span class="p">,</span>
<span class="nv">id: </span><span class="mi">2</span>
<span class="nv">name: </span><span class="s1">'iPad'</span>
<span class="nv">description: </span><span class="s1">'Apple 64GB 3G iPad'</span>
<span class="nv">price: </span><span class="mi">899</span>
<span class="p">]</span>
<span class="nv">module.exports.all = </span><span class="nx">products</span>
<span class="nv">module.exports.find = </span><span class="nf">(id) -></span>
<span class="nv">id = </span><span class="nb">parseInt</span><span class="p">(</span><span class="nx">id</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
<span class="k">for</span> <span class="nx">product</span> <span class="k">in</span> <span class="nx">products</span>
<span class="k">if</span> <span class="nx">product</span><span class="p">.</span><span class="nx">id</span> <span class="o">is</span> <span class="nx">id</span> <span class="k">then</span> <span class="k">return</span> <span class="nx">product</span>
</pre></div> </td> </tr> </tbody> </table> </div> <div id="jump_to"> Jump To … <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="000_intro.html"> 000_intro.coffee </a> <a class="source" href="001_http.html"> 001_http.coffee </a> <a class="source" href="002_child_process.html"> 002_child_process.coffee </a> <a class="source" href="003_pump.html"> 003_pump.coffee </a> <a class="source" href="004_step.html"> 004_step.coffee </a> <a class="source" href="005_chat.html"> 005_chat.coffee </a> <a class="source" href="006_socket_chat.html"> 006_socket_chat.coffee </a> <a class="source" href="007_socket.io_chat.html"> 007_socket.io_chat.coffee </a> <a class="source" href="008_0_connect.html"> 008_0_connect.coffee </a> <a class="source" href="008_1_serve-js.html"> 008_1_serve-js.coffee </a> <a class="source" href="008_2_log-it.html"> 008_2_log-it.coffee </a> <a class="source" href="009_express.html"> 009_express.coffee </a> <a class="source" href="010_0_express.html"> 010_0_express.coffee </a> <a class="source" href="010_1_products.html"> 010_1_products.coffee </a> <a class="source" href="011_0_express.html"> 011_0_express.coffee </a> <a class="source" href="011_1_products.html"> 011_1_products.coffee </a> <a class="source" href="012_0_file_upload.html"> 012_0_file_upload.coffee </a> <a class="source" href="012_1_photos.html"> 012_1_photos.coffee </a> <a class="source" href="012_2_products.html"> 012_2_products.coffee </a> <a class="source" href="013_0_auth.html"> 013_0_auth.coffee </a> <a class="source" href="013_1_photos.html"> 013_1_photos.coffee </a> <a class="source" href="013_2_products.html"> 013_2_products.coffee </a> <a class="source" href="013_3_users.html"> 013_3_users.coffee </a> <a class="source" href="014_0_tools.html"> 014_0_tools.coffee </a> <a class="source" href="015_deploy.html"> 015_deploy.coffee </a> <a class="source" href="016_coffeescript.html"> 016_coffeescript.coffee </a> <a class="source" href="017_0_modules.html"> 017_0_modules.coffee </a> <a class="source" href="017_1_test_modules.html"> 017_1_test_modules.coffee </a> <a class="source" href="018_0_mongoose.html"> 018_0_mongoose.coffee </a> <a class="source" href="018_1_photos.html"> 018_1_photos.coffee </a> <a class="source" href="018_2_products.html"> 018_2_products.coffee </a> <a class="source" href="018_3_users.html"> 018_3_users.coffee </a> <a class="source" href="019_async_interation.html"> 019_async_interation.coffee </a> <a class="source" href="020_tdd.html"> 020_tdd.coffee </a> <a class="source" href="021_mongoose_update.html"> 021_mongoose_update.coffee </a> <a class="source" href="022_bundling.html"> 022_bundling.coffee </a> <a class="source" href="023_express_resources.html"> 023_express_resources.coffee </a> <a class="source" href="024_0_benchmark.html"> 024_0_benchmark.coffee </a> <a class="source" href="024_1_test.html"> 024_1_test.coffee </a> <a class="source" href="024_2_statistics.html"> 024_2_statistics.coffee </a> <a class="source" href="025_nginx.html"> 025_nginx.coffee </a> <a class="source" href="026_0_everyauth.html"> 026_0_everyauth.coffee </a> <a class="source" href="026_1_users.html"> 026_1_users.coffee </a> <a class="source" href="027_0_kue.html"> 027_0_kue.coffee </a> <a class="source" href="027_1_kue_consumer.html"> 027_1_kue_consumer.coffee </a> <a class="source" href="028_classes_prototype_closure.html"> 028_classes_prototype_closure.coffee </a> </div> </div> </div> </body> </html>