Browse Source

Level 6: Classes.

Frederic G. MARAND 6 years ago
parent
commit
e879ceeee4

+ 104 - 41
.idea/workspace.xml

@@ -2,26 +2,38 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="a9e80a2a-c5a3-4f61-9674-b81f51dbb223" name="Default" comment="">
-      <change beforePath="" afterPath="$PROJECT_DIR$/src/4-01-arrays.coffee" />
-      <change beforePath="" afterPath="$PROJECT_DIR$/src/4-02-ranges.coffee" />
-      <change beforePath="" afterPath="$PROJECT_DIR$/src/4-03-splats.coffee" />
-      <change beforePath="" afterPath="$PROJECT_DIR$/src/4-04-objects.coffee" />
-      <change beforePath="" afterPath="$PROJECT_DIR$/src/5-01-jquery.coffee" />
+      <change beforePath="" afterPath="$PROJECT_DIR$/6-2-ex-drink.html" />
+      <change beforePath="" afterPath="$PROJECT_DIR$/src/6-1-class.coffee" />
+      <change beforePath="" afterPath="$PROJECT_DIR$/src/6-2-ex-drink.coffee" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
       <change beforePath="$PROJECT_DIR$/index.html" afterPath="$PROJECT_DIR$/index.html" />
-      <change beforePath="$PROJECT_DIR$/lib/conditions.js" afterPath="" />
-      <change beforePath="$PROJECT_DIR$/lib/conditions.js.map" afterPath="" />
-      <change beforePath="$PROJECT_DIR$/lib/hello.js" afterPath="" />
-      <change beforePath="$PROJECT_DIR$/lib/hello.js.map" afterPath="" />
-      <change beforePath="$PROJECT_DIR$/lib/jquery.js" afterPath="" />
-      <change beforePath="$PROJECT_DIR$/lib/jquery.js.map" afterPath="" />
-      <change beforePath="$PROJECT_DIR$/lib/operators.js" afterPath="" />
-      <change beforePath="$PROJECT_DIR$/lib/operators.js.map" afterPath="" />
-      <change beforePath="$PROJECT_DIR$/package.json" afterPath="$PROJECT_DIR$/package.json" />
-      <change beforePath="$PROJECT_DIR$/src/conditions.coffee" afterPath="$PROJECT_DIR$/src/3-01-conditions.coffee" />
-      <change beforePath="$PROJECT_DIR$/src/hello.coffee" afterPath="$PROJECT_DIR$/src/1-01-hello.coffee" />
-      <change beforePath="$PROJECT_DIR$/src/jquery.coffee" afterPath="$PROJECT_DIR$/src/2-01-jquery.coffee" />
-      <change beforePath="$PROJECT_DIR$/src/operators.coffee" afterPath="$PROJECT_DIR$/src/3-02-operators.coffee" />
+      <change beforePath="$PROJECT_DIR$/lib/1-01-hello.js" afterPath="" />
+      <change beforePath="$PROJECT_DIR$/lib/1-01-hello.js.map" afterPath="" />
+      <change beforePath="$PROJECT_DIR$/lib/2-01-jquery.js" afterPath="" />
+      <change beforePath="$PROJECT_DIR$/lib/2-01-jquery.js.map" afterPath="" />
+      <change beforePath="$PROJECT_DIR$/lib/3-01-conditions.js" afterPath="" />
+      <change beforePath="$PROJECT_DIR$/lib/3-01-conditions.js.map" afterPath="" />
+      <change beforePath="$PROJECT_DIR$/lib/3-02-operators.js" afterPath="" />
+      <change beforePath="$PROJECT_DIR$/lib/3-02-operators.js.map" afterPath="" />
+      <change beforePath="$PROJECT_DIR$/lib/4-01-arrays.js" afterPath="" />
+      <change beforePath="$PROJECT_DIR$/lib/4-01-arrays.js.map" afterPath="" />
+      <change beforePath="$PROJECT_DIR$/lib/4-02-ranges.js" afterPath="" />
+      <change beforePath="$PROJECT_DIR$/lib/4-02-ranges.js.map" afterPath="" />
+      <change beforePath="$PROJECT_DIR$/lib/4-03-splats.js" afterPath="" />
+      <change beforePath="$PROJECT_DIR$/lib/4-03-splats.js.map" afterPath="" />
+      <change beforePath="$PROJECT_DIR$/lib/4-04-objects.js" afterPath="" />
+      <change beforePath="$PROJECT_DIR$/lib/4-04-objects.js.map" afterPath="" />
+      <change beforePath="$PROJECT_DIR$/lib/5-01-jquery.js" afterPath="" />
+      <change beforePath="$PROJECT_DIR$/lib/5-01-jquery.js.map" afterPath="" />
+      <change beforePath="$PROJECT_DIR$/src/1-01-hello.coffee" afterPath="$PROJECT_DIR$/src/1-1-hello.coffee" />
+      <change beforePath="$PROJECT_DIR$/src/2-01-jquery.coffee" afterPath="$PROJECT_DIR$/src/2-1-jquery.coffee" />
+      <change beforePath="$PROJECT_DIR$/src/3-01-conditions.coffee" afterPath="$PROJECT_DIR$/src/3-1-conditions.coffee" />
+      <change beforePath="$PROJECT_DIR$/src/3-02-operators.coffee" afterPath="$PROJECT_DIR$/src/3-2-operators.coffee" />
+      <change beforePath="$PROJECT_DIR$/src/4-01-arrays.coffee" afterPath="$PROJECT_DIR$/src/4-1-arrays.coffee" />
+      <change beforePath="$PROJECT_DIR$/src/4-02-ranges.coffee" afterPath="$PROJECT_DIR$/src/4-2-ranges.coffee" />
+      <change beforePath="$PROJECT_DIR$/src/4-03-splats.coffee" afterPath="$PROJECT_DIR$/src/4-3-splats.coffee" />
+      <change beforePath="$PROJECT_DIR$/src/4-04-objects.coffee" afterPath="$PROJECT_DIR$/src/4-4-objects.coffee" />
+      <change beforePath="$PROJECT_DIR$/src/5-01-jquery.coffee" afterPath="$PROJECT_DIR$/src/5-1-jquery.coffee" />
     </list>
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
     <option name="TRACKING_ENABLED" value="true" />
@@ -57,11 +69,15 @@
         <option value="$PROJECT_DIR$/src/splats.coffee" />
         <option value="$PROJECT_DIR$/package.json" />
         <option value="$PROJECT_DIR$/src/4-03-splats.coffee" />
-        <option value="$PROJECT_DIR$/index.html" />
         <option value="$PROJECT_DIR$/lib/4-04-objects.js" />
         <option value="$PROJECT_DIR$/src/4-04-objects.coffee" />
         <option value="$PROJECT_DIR$/lib/5-01-jquery.js" />
         <option value="$PROJECT_DIR$/src/5-01-jquery.coffee" />
+        <option value="$PROJECT_DIR$/lib/6-1-class.js" />
+        <option value="$PROJECT_DIR$/index.html" />
+        <option value="$PROJECT_DIR$/src/6-1-class.coffee" />
+        <option value="$PROJECT_DIR$/6-2-ex-drink.html" />
+        <option value="$PROJECT_DIR$/src/6-2-ex-drink.coffee" />
       </list>
     </option>
   </component>
@@ -134,7 +150,7 @@
               <item name="coffee-codeschool" type="b2602c69:ProjectViewProjectNode" />
               <item name="coffee-codeschool" type="2a2b976b:PhpTreeStructureProvider$1" />
               <item name="lib" type="2a2b976b:PhpTreeStructureProvider$1" />
-              <item name="5-01-jquery.js" type="620a8d5e:NestingTreeNode" />
+              <item name="6-1-class.js" type="620a8d5e:NestingTreeNode" />
             </path>
             <path>
               <item name="coffee-codeschool" type="b2602c69:ProjectViewProjectNode" />
@@ -166,6 +182,11 @@
     <property name="node.js.selected.package.standard" value="" />
     <property name="NewWatcherDialog.advanced.open" value="true" />
   </component>
+  <component name="RecentsManager">
+    <key name="MoveFile.RECENT_KEYS">
+      <recent name="$PROJECT_DIR$/src" />
+    </key>
+  </component>
   <component name="RunDashboard">
     <option name="ruleStates">
       <list>
@@ -218,23 +239,23 @@
       <workItem from="1519329561859" duration="14000" />
       <workItem from="1519329585238" duration="4143000" />
       <workItem from="1519580966069" duration="8752000" />
-      <workItem from="1519625833056" duration="1738000" />
+      <workItem from="1519625833056" duration="5453000" />
     </task>
     <servers />
   </component>
   <component name="TimeTrackingManager">
-    <option name="totallyTimeSpent" value="14901000" />
+    <option name="totallyTimeSpent" value="18616000" />
   </component>
   <component name="ToolWindowManager">
     <frame x="0" y="23" width="1440" height="877" extended-state="0" />
     <layout>
-      <window_info id="Project" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.17238913" sideWeight="0.5" order="5" side_tool="false" content_ui="combo" />
+      <window_info id="Project" active="true" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.17238913" sideWeight="0.5" order="5" side_tool="false" content_ui="combo" />
       <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
       <window_info id="Docker" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
       <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" />
       <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
       <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
-      <window_info id="Run" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.1892583" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
+      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.1892583" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
       <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.16380544" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
       <window_info id="Mongo Explorer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
       <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32225063" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
@@ -261,7 +282,7 @@
     <watches-manager />
   </component>
   <component name="editorHistoryManager">
-    <entry file="file://$PROJECT_DIR$/src/4-04-objects.coffee">
+    <entry file="file://$PROJECT_DIR$/src/4-4-objects.coffee">
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="0">
           <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
@@ -279,42 +300,46 @@
     </entry>
     <entry file="file://$PROJECT_DIR$/hello.js" />
     <entry file="file://$PROJECT_DIR$/hello.coffee" />
-    <entry file="file://$PROJECT_DIR$/src/1-01-hello.coffee">
+    <entry file="file://$PROJECT_DIR$/src/1-1-hello.coffee">
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="195">
           <caret line="12" column="0" lean-forward="true" selection-start-line="12" selection-start-column="0" selection-end-line="12" selection-end-column="0" />
+          <folding />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/lib/hello.js" />
     <entry file="file://$PROJECT_DIR$/lib/jquery.js" />
-    <entry file="file://$PROJECT_DIR$/src/3-01-conditions.coffee">
+    <entry file="file://$PROJECT_DIR$/src/3-1-conditions.coffee">
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="210">
           <caret line="14" column="0" lean-forward="false" selection-start-line="14" selection-start-column="0" selection-end-line="14" selection-end-column="0" />
+          <folding />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/lib/conditions.js" />
-    <entry file="file://$PROJECT_DIR$/src/3-02-operators.coffee">
+    <entry file="file://$PROJECT_DIR$/src/3-2-operators.coffee">
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="268">
           <caret line="34" column="22" lean-forward="true" selection-start-line="34" selection-start-column="22" selection-end-line="34" selection-end-column="22" />
+          <folding />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/lib/operators.js" />
-    <entry file="file://$PROJECT_DIR$/src/4-02-ranges.coffee">
+    <entry file="file://$PROJECT_DIR$/src/4-2-ranges.coffee">
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="270">
           <caret line="18" column="0" lean-forward="true" selection-start-line="18" selection-start-column="0" selection-end-line="18" selection-end-column="0" />
+          <folding />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/lib/ranges.js" />
     <entry file="file://$PROJECT_DIR$/lib/arrays.js" />
     <entry file="file://$PROJECT_DIR$/lib/splats.js" />
-    <entry file="file://$PROJECT_DIR$/src/4-01-arrays.coffee">
+    <entry file="file://$PROJECT_DIR$/src/4-1-arrays.coffee">
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="375">
           <caret line="25" column="0" lean-forward="true" selection-start-line="25" selection-start-column="0" selection-end-line="25" selection-end-column="0" />
@@ -330,21 +355,15 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/4-03-splats.coffee">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="150">
-          <caret line="10" column="0" lean-forward="true" selection-start-line="10" selection-start-column="0" selection-end-line="10" selection-end-column="0" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/index.html">
+    <entry file="file://$PROJECT_DIR$/src/4-3-splats.coffee">
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="150">
           <caret line="10" column="0" lean-forward="true" selection-start-line="10" selection-start-column="0" selection-end-line="10" selection-end-column="0" />
+          <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/4-04-objects.coffee">
+    <entry file="file://$PROJECT_DIR$/src/4-4-objects.coffee">
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="135">
           <caret line="9" column="8" lean-forward="true" selection-start-line="9" selection-start-column="8" selection-end-line="9" selection-end-column="8" />
@@ -360,7 +379,7 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/2-01-jquery.coffee">
+    <entry file="file://$PROJECT_DIR$/src/2-1-jquery.coffee">
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="15">
           <caret line="1" column="0" lean-forward="true" selection-start-line="0" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
@@ -368,7 +387,7 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/5-01-jquery.coffee">
+    <entry file="file://$PROJECT_DIR$/src/5-1-jquery.coffee">
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="435">
           <caret line="29" column="0" lean-forward="true" selection-start-line="29" selection-start-column="0" selection-end-line="29" selection-end-column="0" />
@@ -384,5 +403,49 @@
         </state>
       </provider>
     </entry>
+    <entry file="file://$PROJECT_DIR$/src/6-1-class.coffee">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="160">
+          <caret line="12" column="27" lean-forward="true" selection-start-line="12" selection-start-column="27" selection-end-line="12" selection-end-column="27" />
+          <folding>
+            <marker date="1519630016251" expanded="true" signature="793:992" ph="..." />
+            <marker date="1519630016251" expanded="true" signature="869:992" ph="..." />
+            <marker date="1519630016251" expanded="true" signature="906:992" ph="..." />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/lib/6-1-class.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="-106">
+          <caret line="38" column="37" lean-forward="true" selection-start-line="38" selection-start-column="37" selection-end-line="38" selection-end-column="37" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/index.html">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="150">
+          <caret line="10" column="0" lean-forward="true" selection-start-line="8" selection-start-column="0" selection-end-line="10" selection-end-column="0" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/6-2-ex-drink.coffee">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="120">
+          <caret line="8" column="0" lean-forward="true" selection-start-line="8" selection-start-column="0" selection-end-line="8" selection-end-column="0" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/6-2-ex-drink.html">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="270">
+          <caret line="22" column="32" lean-forward="true" selection-start-line="22" selection-start-column="32" selection-end-line="22" selection-end-column="32" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
   </component>
 </project>

+ 51 - 0
6-2-ex-drink.html

@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="UTF-8">
+    <title>Title</title>
+  </head>
+  <body>
+    <section>
+      <h2>Calculate your Caffeine Level</h2>
+
+      <div class="menu">
+        <h3>Coffee</h3>
+        <p id="newCoffee"><a href="#">Add Coffee</a></p>
+        <ul class="drink">
+          <li><a href="#" data-level="1">American</a><span class="tooltip">Level 1 Caffeine</span></li>
+          <li><a href="#" data-level="2">Colombian</a><span class="tooltip">Level 2 Caffeine</span></li>
+          <li><a href="#" data-level="3">Brazilian</a><span class="tooltip">Level 3 Caffeine</span></li>
+          <li><a href="#" data-level="10">Espresso</a><span class="tooltip">Level CRAZY Caffeine</span></li>
+        </ul>
+        <label for="total">Total:</label>
+        <input type="text" id="total" size="3" value="0"/>
+        <input type="button" id="clear" size="3" value="Clear"/>
+        <div id="warning"></div>
+        <div id="notice"></div>
+        <div id="advertisement">
+          <p>
+            How about you try our new <a href="#">EnvyLabs Coffee!</a> ?
+          </p>
+        </div>
+      </div>
+    </section>
+    <section>
+      <h3>Store Locations</h3>
+      <ul class="locations">
+      </ul>
+    </section>
+    <section>
+      <article>
+        <h3>Top Pick of the Week</h3>
+        <p id="topPick"></p>
+      </article>
+      <article>
+        <h3>Other Suggested Coffee</h3>
+        <ul class="suggested"></ul>
+      </article>
+
+    </section>
+    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
+    <script src="lib/6-2-ex-drink.js"></script>
+  </body>
+</html>

+ 3 - 1
index.html

@@ -5,6 +5,8 @@
     <title>CoffeeScript playground</title>
   </head>
   <body>
-    <script src="lib/3-01-conditions.js"></script>
+    <button id="pour-French" name="French">French</button>
+    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
+    <script src="lib/6-1-class.js"></script>
   </body>
 </html>

+ 1 - 1
lib/1-01-hello.js → lib/1-1-hello.js

@@ -15,4 +15,4 @@ alert(coffee("Chocolate ?"));
 //`Best practice: parentheses always except at the outermost level.
 alert(coffee("Tea, maybe ?"));
 
-//# sourceMappingURL=1-01-hello.js.map
+//# sourceMappingURL=1-1-hello.js.map

+ 2 - 2
lib/1-01-hello.js.map → lib/1-1-hello.js.map

@@ -1,9 +1,9 @@
 {
   "version": 3,
-  "file": "1-01-hello.js",
+  "file": "1-1-hello.js",
   "sourceRoot": "..",
   "sources": [
-    "src/1-01-hello.coffee"
+    "src/1-1-hello.coffee"
   ],
   "names": [],
   "mappings": "AAAA,IAAA,MAAA,EAAA;;AAAA,OAAA,GAAU;;AAEV,MAAA,GAAS,QAAA,CAAC,MAAM,OAAP,CAAA;AACP,MAAA;EAAA,MAAA,GAAS,OAAA,CAAQ,GAAR;SACT,CAAA,eAAA,CAAA,CAAkB,MAAlB,CAAA;AAFO;;AAKT,KAAA,CAAM,MAAA,CAAA,CAAN,EAPA;;AAQA,KAAA,CAAM,MAAA,CAAO,aAAP,CAAN,EARA;;;AAWA,KAAA,CAAM,MAAA,CAAO,cAAP,CAAN",

+ 1 - 1
lib/2-01-jquery.js → lib/2-1-jquery.js

@@ -26,4 +26,4 @@ showNumberOfFlights = function(e) {
   return $('#tabs span.tooltip').show();
 };
 
-//# sourceMappingURL=2-01-jquery.js.map
+//# sourceMappingURL=2-1-jquery.js.map

File diff suppressed because it is too large
+ 2 - 2
lib/2-1-jquery.js.map


+ 1 - 1
lib/3-01-conditions.js → lib/3-1-conditions.js

@@ -23,4 +23,4 @@ console.log((ref = age < 15) != null ? ref : {
   "Minor": "Elder"
 });
 
-//# sourceMappingURL=3-01-conditions.js.map
+//# sourceMappingURL=3-1-conditions.js.map

+ 2 - 2
lib/3-01-conditions.js.map → lib/3-1-conditions.js.map

@@ -1,9 +1,9 @@
 {
   "version": 3,
-  "file": "3-01-conditions.js",
+  "file": "3-1-conditions.js",
   "sourceRoot": "..",
   "sources": [
-    "src/3-01-conditions.coffee"
+    "src/3-1-conditions.coffee"
   ],
   "names": [],
   "mappings": "AAAA,IAAA,GAAA,EAAA;;AAAA,GAAA,GAAM,MAAA,CAAO,kBAAP,EAA2B,CAA3B;;AAEN,IAAG,GAAA,IAAO,EAAV;EACE,KAAA,CAAM,OAAN,EADF;CAAA,MAAA;EAGE,KAAA,CAAM,UAAN,EAHF;;;AAKA,IAAoB,GAAA,GAAM,EAA1B;EAAA,KAAA,CAAM,UAAN,EAAA;;;AAEA,IAAG,GAAA,GAAM,EAAT;EAAiB,KAAA,CAAM,WAAN,EAAjB;CAAA,MAAA;EAAwC,KAAA,CAAM,QAAN,EAAxC;CATA;;;AAYA,OAAO,CAAC,GAAR,kCAA0B;EAAA,OAAA,EAAU;AAAV,CAA1B",

+ 1 - 1
lib/3-02-operators.js → lib/3-2-operators.js

@@ -88,4 +88,4 @@ if (typeof vehicle.start_engine === "function") {
   }
 }
 
-//# sourceMappingURL=3-02-operators.js.map
+//# sourceMappingURL=3-2-operators.js.map

File diff suppressed because it is too large
+ 2 - 2
lib/3-2-operators.js.map


+ 1 - 1
lib/4-01-arrays.js → lib/4-1-arrays.js

@@ -68,4 +68,4 @@ storeLocations3 = (function() {
 
 console.log(storeLocations3);
 
-//# sourceMappingURL=4-01-arrays.js.map
+//# sourceMappingURL=4-1-arrays.js.map

File diff suppressed because it is too large
+ 2 - 2
lib/4-1-arrays.js.map


+ 1 - 1
lib/4-02-ranges.js → lib/4-2-ranges.js

@@ -38,4 +38,4 @@ console.log(range3.slice(1, +range3.length + 1 || 9e9));
 // Negative indexes
 console.log(range3.slice(1, -1));
 
-//# sourceMappingURL=4-02-ranges.js.map
+//# sourceMappingURL=4-2-ranges.js.map

+ 2 - 2
lib/4-02-ranges.js.map → lib/4-2-ranges.js.map

@@ -1,9 +1,9 @@
 {
   "version": 3,
-  "file": "4-02-ranges.js",
+  "file": "4-2-ranges.js",
   "sourceRoot": "..",
   "sources": [
-    "src/4-02-ranges.coffee"
+    "src/4-2-ranges.coffee"
   ],
   "names": [],
   "mappings": "AAAA,IAAA,GAAA,EAAA,GAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,KAAA,EAAA;;AAAA,GAAA,GAAM;;AACN,GAAA,GAAM,EADN;;;AAIA,MAAA,GAAS;;;;eAJT;;;AAMA,MAAA,GAAS;;;;;;AAET,OAAO,CAAC,GAAR,CAAY,MAAZ,EAAoB,MAApB,EARA;;;AAWA,KAAA,GAAQ;;AACR,GAAA,GAAM;;AACN,MAAA,GAAS;;;;;;AACT,OAAO,CAAC,GAAR,CAAY,MAAO,YAAnB;;AACA,OAAO,CAAC,GAAR,CAAY,MAAO,oCAAnB,EAfA;;;AAiBA,OAAO,CAAC,GAAR,CAAY,MAAO,aAAnB",

+ 1 - 1
lib/4-03-splats.js → lib/4-3-splats.js

@@ -14,4 +14,4 @@ params = ['Orlando', 'Miami', 'Winter Park'];
 
 console.log(searchLocations(coffee, ...params));
 
-//# sourceMappingURL=4-03-splats.js.map
+//# sourceMappingURL=4-3-splats.js.map

+ 2 - 2
lib/4-03-splats.js.map → lib/4-3-splats.js.map

@@ -1,9 +1,9 @@
 {
   "version": 3,
-  "file": "4-03-splats.js",
+  "file": "4-3-splats.js",
   "sourceRoot": "..",
   "sources": [
-    "src/4-03-splats.coffee"
+    "src/4-3-splats.coffee"
   ],
   "names": [],
   "mappings": "AAAA,IAAA,MAAA,EAAA,MAAA,EAAA;;AAAA,MAAA,GAAS;;AAET,eAAA,GAAkB,QAAA,CAAC,KAAD,EAAA,GAAQ,MAAR,CAAA;SAChB,CAAA,YAAA,CAAA,CAAe,KAAf,CAAqB,IAArB,CAAA,CAA2B,MAAM,CAAC,IAAP,CAAY,IAAZ,CAA3B,CAAA;AADgB;;AAGlB,OAAO,CAAC,GAAR,CAAY,eAAA,CAAgB,MAAhB,EAAwB,SAAxB,CAAZ;;AACA,OAAO,CAAC,GAAR,CAAY,eAAA,CAAgB,MAAhB,EAAwB,SAAxB,EAAmC,OAAnC,EAA4C,aAA5C,CAAZ;;AAEA,MAAA,GAAS,CAAC,SAAD,EAAY,OAAZ,EAAqB,aAArB;;AACT,OAAO,CAAC,GAAR,CAAY,eAAA,CAAgB,MAAhB,EAAwB,GAAA,MAAxB,CAAZ",

+ 1 - 1
lib/4-04-objects.js → lib/4-4-objects.js

@@ -80,4 +80,4 @@ to_print = (function() {
 
 console.log(to_print.join(", "));
 
-//# sourceMappingURL=4-04-objects.js.map
+//# sourceMappingURL=4-4-objects.js.map

File diff suppressed because it is too large
+ 2 - 2
lib/4-4-objects.js.map


+ 1 - 1
lib/5-01-jquery.js → lib/5-1-jquery.js

@@ -47,4 +47,4 @@ filteredFlights = (function() {
   return results;
 })();
 
-//# sourceMappingURL=5-01-jquery.js.map
+//# sourceMappingURL=5-1-jquery.js.map

File diff suppressed because it is too large
+ 2 - 2
lib/5-1-jquery.js.map


+ 109 - 0
lib/6-1-class.js

@@ -0,0 +1,109 @@
+var Coffee, Coffee0, JCoffee, MaxgoodHouse, SelectFlights, boring, french, j;
+
+Coffee0 = class Coffee0 {
+  constructor(name, strength = 1) {
+    this.name = name;
+    this.strength = strength;
+  }
+
+};
+
+Coffee = class Coffee {
+  constructor(name1, strength1 = 1) {
+    this.name = name1;
+    this.strength = strength1;
+  }
+
+  brew() {
+    return alert(`brewing ${this.name}`);
+  }
+
+  pour(amount = 1) {
+    if (amount === 1) {
+      return "Poured a single cup";
+    } else {
+      return `Poured ${amount} cups`;
+    }
+  }
+
+};
+
+french = new Coffee("French", 2);
+
+french.brew();
+
+alert(french.pour());
+
+alert(french.pour(2));
+
+MaxgoodHouse = class MaxgoodHouse extends Coffee {
+  // Cannot use @param format, because of the required call to super in Coffee 2.x.
+  constructor(name, strength = 0) {
+    super(name, strength);
+    this.name = name;
+    this.strength = strength;
+    this.brand = "Maxgood House";
+  }
+
+  pour(amount = 1) {
+    return `${super.pour(amount)}, but it sucks`;
+  }
+
+};
+
+boring = new MaxgoodHouse("Boring");
+
+boring.brew();
+
+alert(boring.pour());
+
+JCoffee = class JCoffee {
+  constructor(name1, strength1 = 1, inventory = 0) {
+    this.name = name1;
+    this.strength = strength1;
+    this.inventory = inventory;
+  }
+
+  pourClick() {
+    return $(`#pour-${this.name}`).click((event) => {
+      if (this.inventory !== 0) {
+        this.inventory--;
+        return alert(`Poured a cup of ${this.name}`);
+      } else {
+        return alert(`Out of ${this.name}`);
+      }
+    });
+  }
+
+};
+
+j = new JCoffee("French", 2, 1);
+
+j.pourClick();
+
+SelectFlights = (function() {
+  class SelectFlights {};
+
+  constructor(SelectFlights.fetchingFlights = null)(function() {
+    $("#tabs ul li a").bind({
+      click: this.changeTab
+    });
+    $("#tabs #error a").click((event) => {
+      event.preventDefault();
+      return this.showFlights($("#tabs li a.active").attr("href"));
+    });
+    return {
+      showFlights: function(activeDiv) {
+        return {};
+      },
+      changeTab: (event) => {
+        return {};
+      }
+    };
+  });
+
+  return SelectFlights;
+
+}).call(this);
+
+//# sourceMappingURL=6-1-class.js.map

File diff suppressed because it is too large
+ 8 - 0
lib/6-1-class.js.map


+ 17 - 0
lib/6-2-ex-drink.js

@@ -0,0 +1,17 @@
+var DrinkLink, d;
+
+DrinkLink = class DrinkLink {
+  watchClick() {
+    return $('a').click((e) => {
+      e.preventDefault();
+      return $(e.currentTarget).css('color', '#F0F');
+    });
+  }
+
+};
+
+d = new DrinkLink();
+
+d.watchClick();
+
+//# sourceMappingURL=6-2-ex-drink.js.map

+ 13 - 0
lib/6-2-ex-drink.js.map

@@ -0,0 +1,13 @@
+{
+  "version": 3,
+  "file": "6-2-ex-drink.js",
+  "sourceRoot": "..",
+  "sources": [
+    "src/6-2-ex-drink.coffee"
+  ],
+  "names": [],
+  "mappings": "AAAA,IAAA,SAAA,EAAA;;AAAM,YAAN,MAAA,UAAA;EACE,UAAY,CAAA,CAAA;WACV,CAAA,CAAE,GAAF,CAAM,CAAC,KAAP,CAAa,CAAC,CAAD,CAAA,GAAA;MACX,CAAC,CAAC,cAAF,CAAA;aACA,CAAA,CAAE,CAAC,CAAC,aAAJ,CAAkB,CAAC,GAAnB,CAAuB,OAAvB,EAAgC,MAAhC;IAFW,CAAb;EADU;;AADd;;AAMA,CAAA,GAAI,IAAI,SAAJ,CAAA;;AACJ,CAAC,CAAC,UAAF,CAAA",
+  "sourcesContent": [
+    "class DrinkLink\n  watchClick: ->\n    $('a').click (e) =>\n      e.preventDefault()\n      $(e.currentTarget).css('color', '#F0F')\n\nd = new DrinkLink()\nd.watchClick()\n"
+  ]
+}

+ 0 - 0
src/1-01-hello.coffee → src/1-1-hello.coffee


+ 0 - 0
src/2-01-jquery.coffee → src/2-1-jquery.coffee


+ 0 - 0
src/3-01-conditions.coffee → src/3-1-conditions.coffee


+ 0 - 0
src/3-02-operators.coffee → src/3-2-operators.coffee


+ 0 - 0
src/4-01-arrays.coffee → src/4-1-arrays.coffee


+ 0 - 0
src/4-02-ranges.coffee → src/4-2-ranges.coffee


+ 0 - 0
src/4-03-splats.coffee → src/4-3-splats.coffee


+ 0 - 0
src/4-04-objects.coffee → src/4-4-objects.coffee


+ 0 - 0
src/5-01-jquery.coffee → src/5-1-jquery.coffee


+ 61 - 0
src/6-1-class.coffee

@@ -0,0 +1,61 @@
+class Coffee0
+  constructor: (name, strength = 1) ->
+    @name = name
+    @strength = strength
+
+class Coffee
+  constructor: (@name, @strength = 1) ->
+
+  brew: -> alert "brewing #{@name}"
+
+  pour: (amount = 1) ->
+    if amount is 1
+      "Poured a single cup"
+    else
+      "Poured #{amount} cups"
+
+french = new Coffee("French", 2)
+french.brew()
+alert(french.pour())
+alert(french.pour(2))
+
+class MaxgoodHouse extends Coffee
+  # Cannot use @param format, because of the required call to super in Coffee 2.x.
+  constructor: (name, strength = 0) ->
+    super name, strength
+    @name = name
+    @strength = strength
+    @brand = "Maxgood House"
+
+  pour: (amount = 1) ->
+    "#{super(amount)}, but it sucks"
+
+boring = new MaxgoodHouse("Boring")
+boring.brew()
+alert(boring.pour())
+
+class JCoffee
+  constructor: (@name, @strength = 1, @inventory = 0) ->
+
+  pourClick: ->
+    $("#pour-#{@name}").click (event) =>
+      if @inventory != 0
+        @inventory--
+        alert "Poured a cup of #{@name}"
+      else
+        alert "Out of #{@name}"
+
+j = new JCoffee "French", 2, 1
+j.pourClick()
+
+class SelectFlights
+  constructor(@fetchingFlights = null) ->
+    $("#tabs ul li a").bind
+      click: @changeTab
+
+    $("#tabs #error a").click (event) =>
+      event.preventDefault()
+      @showFlights $("#tabs li a.active").attr("href")
+
+    showFlights: (activeDiv) -> {}
+    changeTab: (event) => {}

+ 8 - 0
src/6-2-ex-drink.coffee

@@ -0,0 +1,8 @@
+class DrinkLink
+  watchClick: ->
+    $('a').click (e) =>
+      e.preventDefault()
+      $(e.currentTarget).css('color', '#F0F')
+
+d = new DrinkLink()
+d.watchClick()

Some files were not shown because too many files changed in this diff