diff --git a/Modules/Context.js b/Modules/Context.js
deleted file mode 100644
index 3d5f250..0000000
--- a/Modules/Context.js
+++ /dev/null
@@ -1,37 +0,0 @@
-var Observable = require("FuseJS/Observable");
-var Backend = require("./Backend");
-
-var hikes = Observable();
-
-Backend.getHikes()
- .then(function(newHikes) {
- hikes.replaceAll(newHikes);
- })
- .catch(function(error) {
- console.log("Couldn't get hikes: " + error);
- });
-
-function updateHike(id, name, location, distance, rating, comments) {
- for (var i = 0; i < hikes.length; i++) {
- var hike = hikes.getAt(i);
- if (hike.id == id) {
- hike.name = name;
- hike.location = location;
- hike.distance = distance;
- hike.rating = rating;
- hike.comments = comments;
- hikes.replaceAt(i, hike);
- break;
- }
- }
- Backend.updateHike(id, name, location, distance, rating, comments)
- .catch(function(error) {
- console.log("Couldn't update hike: " + id);
- });
-}
-
-module.exports = {
- hikes: hikes,
-
- updateHike: updateHike
-};
\ No newline at end of file
diff --git a/Pages/EditHikePage.js b/Pages/EditHikePage.js
deleted file mode 100644
index e33b3e6..0000000
--- a/Pages/EditHikePage.js
+++ /dev/null
@@ -1,31 +0,0 @@
-var Context = require("Modules/Context");
-
-var hike = this.Parameter;
-
-var name = hike.map(function(x) { return x.name; });
-var location = hike.map(function(x) { return x.location; });
-var distance = hike.map(function(x) { return x.distance; });
-var rating = hike.map(function(x) { return x.rating; });
-var comments = hike.map(function(x) { return x.comments; });
-
-function cancel() {
- // Refresh hike value to reset dependent Observables' values
- hike.value = hike.value;
- router.goBack();
-}
-
-function save() {
- Context.updateHike(hike.value.id, name.value, location.value, distance.value, rating.value, comments.value);
- router.goBack();
-}
-
-module.exports = {
- name: name,
- location: location,
- distance: distance,
- rating: rating,
- comments: comments,
-
- cancel: cancel,
- save: save
-};
\ No newline at end of file
diff --git a/.gitignore b/chapter-1/.gitignore
similarity index 100%
rename from .gitignore
rename to chapter-1/.gitignore
diff --git a/LICENSE b/chapter-1/LICENSE
similarity index 100%
rename from LICENSE
rename to chapter-1/LICENSE
diff --git a/chapter-1/MainView.ux b/chapter-1/MainView.ux
new file mode 100644
index 0000000..e5dcdf1
--- /dev/null
+++ b/chapter-1/MainView.ux
@@ -0,0 +1,42 @@
+
+
+
+ var Observable = require("FuseJS/Observable");
+
+ var name = Observable("Tricky Trails");
+ var location = Observable("Lakebed, Utah");
+ var distance = Observable(10.4);
+ var rating = Observable(4);
+ var comments = Observable("This hike was nice and hike-like. Glad I didn't bring a bike.");
+
+ module.exports = {
+ name: name,
+ location: location,
+ distance: distance,
+ rating: rating,
+ comments: comments
+ };
+
+
+
+
+
+
+ Name:
+
+
+ Location:
+
+
+ Distance (km):
+
+
+ Rating:
+
+
+ Comments:
+
+
+
+
+
diff --git a/README.md b/chapter-1/README.md
similarity index 100%
rename from README.md
rename to chapter-1/README.md
diff --git a/hikr.gif b/chapter-1/hikr.gif
similarity index 100%
rename from hikr.gif
rename to chapter-1/hikr.gif
diff --git a/chapter-1/hikr.unoproj b/chapter-1/hikr.unoproj
new file mode 100644
index 0000000..36acee3
--- /dev/null
+++ b/chapter-1/hikr.unoproj
@@ -0,0 +1,10 @@
+{
+ "RootNamespace":"",
+ "Packages": [
+ "Fuse",
+ "FuseJS"
+ ],
+ "Includes": [
+ "*"
+ ]
+}
diff --git a/chapter-2/.gitignore b/chapter-2/.gitignore
new file mode 100644
index 0000000..a0ada99
--- /dev/null
+++ b/chapter-2/.gitignore
@@ -0,0 +1,2 @@
+build/
+.uno/
diff --git a/chapter-2/LICENSE b/chapter-2/LICENSE
new file mode 100644
index 0000000..3ad225c
--- /dev/null
+++ b/chapter-2/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Fuse
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/chapter-2/MainView.ux b/chapter-2/MainView.ux
new file mode 100644
index 0000000..5528cc6
--- /dev/null
+++ b/chapter-2/MainView.ux
@@ -0,0 +1,89 @@
+
+
+
+ var Observable = require("FuseJS/Observable");
+
+ var hikes = [
+ {
+ id: 0,
+ name: "Tricky Trails",
+ location: "Lakebed, Utah",
+ distance: 10.4,
+ rating: 4,
+ comments: "This hike was nice and hike-like. Glad I didn't bring a bike."
+ },
+ {
+ id: 1,
+ name: "Mondo Mountains",
+ location: "Black Hills, South Dakota",
+ distance: 20.86,
+ rating: 3,
+ comments: "Not the best, but would probably do again. Note to self: don't forget the sandwiches next time."
+ },
+ {
+ id: 2,
+ name: "Pesky Peaks",
+ location: "Bergenhagen, Norway",
+ distance: 8.2,
+ rating: 5,
+ comments: "Short but SO sweet!!"
+ },
+ {
+ id: 3,
+ name: "Rad Rivers",
+ location: "Moriyama, Japan",
+ distance: 12.3,
+ rating: 4,
+ comments: "Took my time with this one. Great view!"
+ },
+ {
+ id: 4,
+ name: "Dangerous Dirt",
+ location: "Cactus, Arizona",
+ distance: 19.34,
+ rating: 2,
+ comments: "Too long, too hot. Also that snakebite wasn't very fun."
+ }
+ ];
+
+ var hike = Observable();
+
+ function chooseHike(arg) {
+ hike.value = arg.data;
+ }
+
+ module.exports = {
+ hikes: hikes,
+
+ hike: hike,
+
+ chooseHike: chooseHike
+ };
+
+
+
+
+
+
+
+
+
+
+ Name:
+
+
+ Location:
+
+
+ Distance (km):
+
+
+ Rating:
+
+
+ Comments:
+
+
+
+
+
diff --git a/chapter-2/README.md b/chapter-2/README.md
new file mode 100644
index 0000000..32c179c
--- /dev/null
+++ b/chapter-2/README.md
@@ -0,0 +1,14 @@
+# hikr
+Pronounced "hiker" (/ˈhaɪkə(r)/), hikr is a basic hike-tracking app.
+
+
+
+## basic info
+hikr is an example app case to accompany Fuse's [end-to-end Fuse app tutorial](https://www.fusetools.com/docs/tutorial/tutorial).
+
+_Note: there have been some force-pushes on this repo, so if you've cloned it before the series went live, it's probably a good idea to delete it and clone again._
+
+## license
+This code is licensed under the MIT license (see LICENSE).
+
+The provided video file (`Assets/nature.mp4`) is a modified version of [Graham Uhelski](https://vimeo.com/mankindfilms)'s ["The Valley"](http://mazwai.com/#/videos/220). It is licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/).
diff --git a/chapter-2/hikr.gif b/chapter-2/hikr.gif
new file mode 100644
index 0000000..e26f354
Binary files /dev/null and b/chapter-2/hikr.gif differ
diff --git a/chapter-2/hikr.unoproj b/chapter-2/hikr.unoproj
new file mode 100644
index 0000000..36acee3
--- /dev/null
+++ b/chapter-2/hikr.unoproj
@@ -0,0 +1,10 @@
+{
+ "RootNamespace":"",
+ "Packages": [
+ "Fuse",
+ "FuseJS"
+ ],
+ "Includes": [
+ "*"
+ ]
+}
diff --git a/chapter-3/.gitignore b/chapter-3/.gitignore
new file mode 100644
index 0000000..a0ada99
--- /dev/null
+++ b/chapter-3/.gitignore
@@ -0,0 +1,2 @@
+build/
+.uno/
diff --git a/chapter-3/LICENSE b/chapter-3/LICENSE
new file mode 100644
index 0000000..3ad225c
--- /dev/null
+++ b/chapter-3/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Fuse
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/chapter-3/MainView.ux b/chapter-3/MainView.ux
new file mode 100644
index 0000000..279a0dc
--- /dev/null
+++ b/chapter-3/MainView.ux
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/chapter-3/Pages/EditHikePage.js b/chapter-3/Pages/EditHikePage.js
new file mode 100644
index 0000000..2049e81
--- /dev/null
+++ b/chapter-3/Pages/EditHikePage.js
@@ -0,0 +1,7 @@
+var Observable = require("FuseJS/Observable");
+
+var hike = Observable();
+
+module.exports = {
+ hike: hike
+};
\ No newline at end of file
diff --git a/chapter-3/Pages/EditHikePage.ux b/chapter-3/Pages/EditHikePage.ux
new file mode 100644
index 0000000..70f6a05
--- /dev/null
+++ b/chapter-3/Pages/EditHikePage.ux
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+ Name:
+
+
+ Location:
+
+
+ Distance (km):
+
+
+ Rating:
+
+
+ Comments:
+
+
+
+
\ No newline at end of file
diff --git a/chapter-3/Pages/HomePage.js b/chapter-3/Pages/HomePage.js
new file mode 100644
index 0000000..48bc378
--- /dev/null
+++ b/chapter-3/Pages/HomePage.js
@@ -0,0 +1,11 @@
+var hikes = require("hikes");
+
+function chooseHike(arg) {
+ // TODO
+}
+
+module.exports = {
+ hikes: hikes,
+
+ chooseHike: chooseHike
+};
\ No newline at end of file
diff --git a/chapter-3/Pages/HomePage.ux b/chapter-3/Pages/HomePage.ux
new file mode 100644
index 0000000..76c417b
--- /dev/null
+++ b/chapter-3/Pages/HomePage.ux
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/chapter-3/README.md b/chapter-3/README.md
new file mode 100644
index 0000000..32c179c
--- /dev/null
+++ b/chapter-3/README.md
@@ -0,0 +1,14 @@
+# hikr
+Pronounced "hiker" (/ˈhaɪkə(r)/), hikr is a basic hike-tracking app.
+
+
+
+## basic info
+hikr is an example app case to accompany Fuse's [end-to-end Fuse app tutorial](https://www.fusetools.com/docs/tutorial/tutorial).
+
+_Note: there have been some force-pushes on this repo, so if you've cloned it before the series went live, it's probably a good idea to delete it and clone again._
+
+## license
+This code is licensed under the MIT license (see LICENSE).
+
+The provided video file (`Assets/nature.mp4`) is a modified version of [Graham Uhelski](https://vimeo.com/mankindfilms)'s ["The Valley"](http://mazwai.com/#/videos/220). It is licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/).
diff --git a/chapter-3/hikes.js b/chapter-3/hikes.js
new file mode 100644
index 0000000..d90215d
--- /dev/null
+++ b/chapter-3/hikes.js
@@ -0,0 +1,44 @@
+var hikes = [
+ {
+ id: 0,
+ name: "Tricky Trails",
+ location: "Lakebed, Utah",
+ distance: 10.4,
+ rating: 4,
+ comments: "This hike was nice and hike-like. Glad I didn't bring a bike."
+ },
+ {
+ id: 1,
+ name: "Mondo Mountains",
+ location: "Black Hills, South Dakota",
+ distance: 20.86,
+ rating: 3,
+ comments: "Not the best, but would probably do again. Note to self: don't forget the sandwiches next time."
+ },
+ {
+ id: 2,
+ name: "Pesky Peaks",
+ location: "Bergenhagen, Norway",
+ distance: 8.2,
+ rating: 5,
+ comments: "Short but SO sweet!!"
+ },
+ {
+ id: 3,
+ name: "Rad Rivers",
+ location: "Moriyama, Japan",
+ distance: 12.3,
+ rating: 4,
+ comments: "Took my time with this one. Great view!"
+ },
+ {
+ id: 4,
+ name: "Dangerous Dirt",
+ location: "Cactus, Arizona",
+ distance: 19.34,
+ rating: 2,
+ comments: "Too long, too hot. Also that snakebite wasn't very fun."
+ }
+];
+
+module.exports = hikes;
\ No newline at end of file
diff --git a/chapter-3/hikr.gif b/chapter-3/hikr.gif
new file mode 100644
index 0000000..e26f354
Binary files /dev/null and b/chapter-3/hikr.gif differ
diff --git a/chapter-3/hikr.unoproj b/chapter-3/hikr.unoproj
new file mode 100644
index 0000000..38c1028
--- /dev/null
+++ b/chapter-3/hikr.unoproj
@@ -0,0 +1,11 @@
+{
+ "RootNamespace":"",
+ "Packages": [
+ "Fuse",
+ "FuseJS"
+ ],
+ "Includes": [
+ "*",
+ "hikes.js:Bundle"
+ ]
+}
diff --git a/chapter-4/.gitignore b/chapter-4/.gitignore
new file mode 100644
index 0000000..a0ada99
--- /dev/null
+++ b/chapter-4/.gitignore
@@ -0,0 +1,2 @@
+build/
+.uno/
diff --git a/chapter-4/LICENSE b/chapter-4/LICENSE
new file mode 100644
index 0000000..3ad225c
--- /dev/null
+++ b/chapter-4/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Fuse
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/chapter-4/MainView.ux b/chapter-4/MainView.ux
new file mode 100644
index 0000000..a16ff4c
--- /dev/null
+++ b/chapter-4/MainView.ux
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter-4/Pages/EditHikePage.js b/chapter-4/Pages/EditHikePage.js
new file mode 100644
index 0000000..a0d9ca3
--- /dev/null
+++ b/chapter-4/Pages/EditHikePage.js
@@ -0,0 +1,11 @@
+var hike = this.Parameter;
+
+function goBack() {
+ router.goBack();
+}
+
+module.exports = {
+ hike: hike,
+
+ goBack: goBack
+};
\ No newline at end of file
diff --git a/chapter-4/Pages/EditHikePage.ux b/chapter-4/Pages/EditHikePage.ux
new file mode 100644
index 0000000..df92161
--- /dev/null
+++ b/chapter-4/Pages/EditHikePage.ux
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+ Name:
+
+
+ Location:
+
+
+ Distance (km):
+
+
+ Rating:
+
+
+ Comments:
+
+
+
+
+
+
\ No newline at end of file
diff --git a/chapter-4/Pages/HomePage.js b/chapter-4/Pages/HomePage.js
new file mode 100644
index 0000000..0ff7199
--- /dev/null
+++ b/chapter-4/Pages/HomePage.js
@@ -0,0 +1,12 @@
+var hikes = require("hikes");
+
+function goToHike(arg) {
+ var hike = arg.data;
+ router.push("editHike", hike);
+}
+
+module.exports = {
+ hikes: hikes,
+
+ goToHike: goToHike
+};
\ No newline at end of file
diff --git a/chapter-4/Pages/HomePage.ux b/chapter-4/Pages/HomePage.ux
new file mode 100644
index 0000000..54003cd
--- /dev/null
+++ b/chapter-4/Pages/HomePage.ux
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/chapter-4/README.md b/chapter-4/README.md
new file mode 100644
index 0000000..32c179c
--- /dev/null
+++ b/chapter-4/README.md
@@ -0,0 +1,14 @@
+# hikr
+Pronounced "hiker" (/ˈhaɪkə(r)/), hikr is a basic hike-tracking app.
+
+
+
+## basic info
+hikr is an example app case to accompany Fuse's [end-to-end Fuse app tutorial](https://www.fusetools.com/docs/tutorial/tutorial).
+
+_Note: there have been some force-pushes on this repo, so if you've cloned it before the series went live, it's probably a good idea to delete it and clone again._
+
+## license
+This code is licensed under the MIT license (see LICENSE).
+
+The provided video file (`Assets/nature.mp4`) is a modified version of [Graham Uhelski](https://vimeo.com/mankindfilms)'s ["The Valley"](http://mazwai.com/#/videos/220). It is licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/).
diff --git a/chapter-4/hikes.js b/chapter-4/hikes.js
new file mode 100644
index 0000000..d90215d
--- /dev/null
+++ b/chapter-4/hikes.js
@@ -0,0 +1,44 @@
+var hikes = [
+ {
+ id: 0,
+ name: "Tricky Trails",
+ location: "Lakebed, Utah",
+ distance: 10.4,
+ rating: 4,
+ comments: "This hike was nice and hike-like. Glad I didn't bring a bike."
+ },
+ {
+ id: 1,
+ name: "Mondo Mountains",
+ location: "Black Hills, South Dakota",
+ distance: 20.86,
+ rating: 3,
+ comments: "Not the best, but would probably do again. Note to self: don't forget the sandwiches next time."
+ },
+ {
+ id: 2,
+ name: "Pesky Peaks",
+ location: "Bergenhagen, Norway",
+ distance: 8.2,
+ rating: 5,
+ comments: "Short but SO sweet!!"
+ },
+ {
+ id: 3,
+ name: "Rad Rivers",
+ location: "Moriyama, Japan",
+ distance: 12.3,
+ rating: 4,
+ comments: "Took my time with this one. Great view!"
+ },
+ {
+ id: 4,
+ name: "Dangerous Dirt",
+ location: "Cactus, Arizona",
+ distance: 19.34,
+ rating: 2,
+ comments: "Too long, too hot. Also that snakebite wasn't very fun."
+ }
+];
+
+module.exports = hikes;
\ No newline at end of file
diff --git a/chapter-4/hikr.gif b/chapter-4/hikr.gif
new file mode 100644
index 0000000..e26f354
Binary files /dev/null and b/chapter-4/hikr.gif differ
diff --git a/chapter-4/hikr.unoproj b/chapter-4/hikr.unoproj
new file mode 100644
index 0000000..38c1028
--- /dev/null
+++ b/chapter-4/hikr.unoproj
@@ -0,0 +1,11 @@
+{
+ "RootNamespace":"",
+ "Packages": [
+ "Fuse",
+ "FuseJS"
+ ],
+ "Includes": [
+ "*",
+ "hikes.js:Bundle"
+ ]
+}
diff --git a/chapter-6/.gitignore b/chapter-6/.gitignore
new file mode 100644
index 0000000..a0ada99
--- /dev/null
+++ b/chapter-6/.gitignore
@@ -0,0 +1,2 @@
+build/
+.uno/
diff --git a/chapter-6/LICENSE b/chapter-6/LICENSE
new file mode 100644
index 0000000..3ad225c
--- /dev/null
+++ b/chapter-6/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Fuse
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/chapter-6/MainView.ux b/chapter-6/MainView.ux
new file mode 100644
index 0000000..a16ff4c
--- /dev/null
+++ b/chapter-6/MainView.ux
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/Modules/Backend.js b/chapter-6/Modules/Backend.js
similarity index 100%
rename from Modules/Backend.js
rename to chapter-6/Modules/Backend.js
diff --git a/chapter-6/Modules/Context.js b/chapter-6/Modules/Context.js
new file mode 100644
index 0000000..2a46523
--- /dev/null
+++ b/chapter-6/Modules/Context.js
@@ -0,0 +1,53 @@
+var Observable = require("FuseJS/Observable");
+var Backend = require("./Backend");
+
+var hikes = Observable();
+
+function CreateObservableHike(backendHike) {
+ var obj = {};
+ obj.id = Observable(backendHike.id);
+ obj.name = Observable(backendHike.name);
+ obj.location = Observable(backendHike.location);
+ obj.distance = Observable(backendHike.distance);
+ obj.rating = Observable(backendHike.rating);
+ obj.comments = Observable(backendHike.comments);
+
+ obj.save = function() {
+ Backend.updateHike(obj.id.value, obj.name.value, obj.location.value, obj.distance.value, obj.rating.value, obj.comments.value)
+ .catch(function(error) {
+ console.log("Couldn't update hike: " + obj.id.value);
+ });
+ }
+ obj.reset = function() {
+ obj.id.value = backendHike.id;
+ obj.name.value = backendHike.name;
+ obj.location.value = backendHike.location;
+ obj.distance.value = backendHike.distance;
+ obj.rating.value = backendHike.rating;
+ obj.comments.value = backendHike.comments;
+ }
+ return obj;
+}
+function getHike(id) {
+ for(var i = 0; i < hikes.length; i++) {
+ if(hikes.getAt(i).id.value==id) {
+ return hikes.getAt(i);
+ }
+ }
+}
+
+Backend.getHikes()
+ .then(function(newHikes) {
+ for(var i = 0; i < newHikes.length; i++) {
+ newHikes[i] = CreateObservableHike(newHikes[i]);
+ }
+ hikes.replaceAll(newHikes);
+ })
+ .catch(function(error) {
+ console.log("Couldn't get hikes: " + error);
+ });
+
+module.exports = {
+ hikes: hikes,
+ getHike: getHike
+};
\ No newline at end of file
diff --git a/chapter-6/Pages/EditHikePage.js b/chapter-6/Pages/EditHikePage.js
new file mode 100644
index 0000000..468682c
--- /dev/null
+++ b/chapter-6/Pages/EditHikePage.js
@@ -0,0 +1,20 @@
+var Context = require("Modules/Context");
+
+var hike = this.Parameter.map(function(x) { return Context.getHike(x)});
+
+function cancel() {
+ hike.value.reset();
+ router.goBack();
+}
+
+function save() {
+ hike.value.save();
+ router.goBack();
+}
+
+module.exports = {
+ hike: hike,
+
+ cancel: cancel,
+ save: save
+};
\ No newline at end of file
diff --git a/chapter-6/Pages/EditHikePage.ux b/chapter-6/Pages/EditHikePage.ux
new file mode 100644
index 0000000..d30492f
--- /dev/null
+++ b/chapter-6/Pages/EditHikePage.ux
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+ Name:
+
+
+ Location:
+
+
+ Distance (km):
+
+
+ Rating:
+
+
+ Comments:
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Pages/HomePage.js b/chapter-6/Pages/HomePage.js
similarity index 79%
rename from Pages/HomePage.js
rename to chapter-6/Pages/HomePage.js
index 90832ee..2edde6c 100644
--- a/Pages/HomePage.js
+++ b/chapter-6/Pages/HomePage.js
@@ -2,7 +2,7 @@ var Context = require("Modules/Context");
function goToHike(arg) {
var hike = arg.data;
- router.push("editHike", hike);
+ router.push("editHike", hike.id.value);
}
module.exports = {
diff --git a/chapter-6/Pages/HomePage.ux b/chapter-6/Pages/HomePage.ux
new file mode 100644
index 0000000..54003cd
--- /dev/null
+++ b/chapter-6/Pages/HomePage.ux
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/chapter-6/README.md b/chapter-6/README.md
new file mode 100644
index 0000000..32c179c
--- /dev/null
+++ b/chapter-6/README.md
@@ -0,0 +1,14 @@
+# hikr
+Pronounced "hiker" (/ˈhaɪkə(r)/), hikr is a basic hike-tracking app.
+
+
+
+## basic info
+hikr is an example app case to accompany Fuse's [end-to-end Fuse app tutorial](https://www.fusetools.com/docs/tutorial/tutorial).
+
+_Note: there have been some force-pushes on this repo, so if you've cloned it before the series went live, it's probably a good idea to delete it and clone again._
+
+## license
+This code is licensed under the MIT license (see LICENSE).
+
+The provided video file (`Assets/nature.mp4`) is a modified version of [Graham Uhelski](https://vimeo.com/mankindfilms)'s ["The Valley"](http://mazwai.com/#/videos/220). It is licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/).
diff --git a/chapter-6/hikr.gif b/chapter-6/hikr.gif
new file mode 100644
index 0000000..e26f354
Binary files /dev/null and b/chapter-6/hikr.gif differ
diff --git a/hikr.unoproj b/chapter-6/hikr.unoproj
similarity index 100%
rename from hikr.unoproj
rename to chapter-6/hikr.unoproj
diff --git a/chapter-7/.gitignore b/chapter-7/.gitignore
new file mode 100644
index 0000000..a0ada99
--- /dev/null
+++ b/chapter-7/.gitignore
@@ -0,0 +1,2 @@
+build/
+.uno/
diff --git a/Assets/background.jpg b/chapter-7/Assets/background.jpg
similarity index 100%
rename from Assets/background.jpg
rename to chapter-7/Assets/background.jpg
diff --git a/chapter-7/Components/hikr.Button.ux b/chapter-7/Components/hikr.Button.ux
new file mode 100644
index 0000000..5fd583b
--- /dev/null
+++ b/chapter-7/Components/hikr.Button.ux
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Components/hikr.Page.ux b/chapter-7/Components/hikr.Page.ux
similarity index 100%
rename from Components/hikr.Page.ux
rename to chapter-7/Components/hikr.Page.ux
diff --git a/Components/hikr.Text.ux b/chapter-7/Components/hikr.Text.ux
similarity index 100%
rename from Components/hikr.Text.ux
rename to chapter-7/Components/hikr.Text.ux
diff --git a/Components/hikr.TextBox.ux b/chapter-7/Components/hikr.TextBox.ux
old mode 100755
new mode 100644
similarity index 100%
rename from Components/hikr.TextBox.ux
rename to chapter-7/Components/hikr.TextBox.ux
diff --git a/Components/hikr.TextView.ux b/chapter-7/Components/hikr.TextView.ux
old mode 100755
new mode 100644
similarity index 100%
rename from Components/hikr.TextView.ux
rename to chapter-7/Components/hikr.TextView.ux
diff --git a/chapter-7/LICENSE b/chapter-7/LICENSE
new file mode 100644
index 0000000..3ad225c
--- /dev/null
+++ b/chapter-7/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Fuse
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/chapter-7/MainView.ux b/chapter-7/MainView.ux
new file mode 100644
index 0000000..36f6fa3
--- /dev/null
+++ b/chapter-7/MainView.ux
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter-7/Modules/Backend.js b/chapter-7/Modules/Backend.js
new file mode 100644
index 0000000..6e1e33e
--- /dev/null
+++ b/chapter-7/Modules/Backend.js
@@ -0,0 +1,75 @@
+var hikes = [
+ {
+ id: 0,
+ name: "Tricky Trails",
+ location: "Lakebed, Utah",
+ distance: 10.4,
+ rating: 4,
+ comments: "This hike was nice and hike-like. Glad I didn't bring a bike."
+ },
+ {
+ id: 1,
+ name: "Mondo Mountains",
+ location: "Black Hills, South Dakota",
+ distance: 20.86,
+ rating: 3,
+ comments: "Not the best, but would probably do again. Note to self: don't forget the sandwiches next time."
+ },
+ {
+ id: 2,
+ name: "Pesky Peaks",
+ location: "Bergenhagen, Norway",
+ distance: 8.2,
+ rating: 5,
+ comments: "Short but SO sweet!!"
+ },
+ {
+ id: 3,
+ name: "Rad Rivers",
+ location: "Moriyama, Japan",
+ distance: 12.3,
+ rating: 4,
+ comments: "Took my time with this one. Great view!"
+ },
+ {
+ id: 4,
+ name: "Dangerous Dirt",
+ location: "Cactus, Arizona",
+ distance: 19.34,
+ rating: 2,
+ comments: "Too long, too hot. Also that snakebite wasn't very fun."
+ }
+];
+
+function getHikes() {
+ return new Promise(function(resolve, reject) {
+ setTimeout(function() {
+ resolve(hikes);
+ }, 0);
+ });
+}
+
+function updateHike(id, name, location, distance, rating, comments) {
+ return new Promise(function(resolve, reject) {
+ setTimeout(function() {
+ for (var i = 0; i < hikes.length; i++) {
+ var hike = hikes[i];
+ if (hike.id == id) {
+ hike.name = name;
+ hike.location = location;
+ hike.distance = distance;
+ hike.rating = rating;
+ hike.comments = comments;
+ break;
+ }
+ }
+
+ resolve();
+ }, 0);
+ });
+}
+
+module.exports = {
+ getHikes: getHikes,
+ updateHike: updateHike
+};
\ No newline at end of file
diff --git a/chapter-7/Modules/Context.js b/chapter-7/Modules/Context.js
new file mode 100644
index 0000000..2a46523
--- /dev/null
+++ b/chapter-7/Modules/Context.js
@@ -0,0 +1,53 @@
+var Observable = require("FuseJS/Observable");
+var Backend = require("./Backend");
+
+var hikes = Observable();
+
+function CreateObservableHike(backendHike) {
+ var obj = {};
+ obj.id = Observable(backendHike.id);
+ obj.name = Observable(backendHike.name);
+ obj.location = Observable(backendHike.location);
+ obj.distance = Observable(backendHike.distance);
+ obj.rating = Observable(backendHike.rating);
+ obj.comments = Observable(backendHike.comments);
+
+ obj.save = function() {
+ Backend.updateHike(obj.id.value, obj.name.value, obj.location.value, obj.distance.value, obj.rating.value, obj.comments.value)
+ .catch(function(error) {
+ console.log("Couldn't update hike: " + obj.id.value);
+ });
+ }
+ obj.reset = function() {
+ obj.id.value = backendHike.id;
+ obj.name.value = backendHike.name;
+ obj.location.value = backendHike.location;
+ obj.distance.value = backendHike.distance;
+ obj.rating.value = backendHike.rating;
+ obj.comments.value = backendHike.comments;
+ }
+ return obj;
+}
+function getHike(id) {
+ for(var i = 0; i < hikes.length; i++) {
+ if(hikes.getAt(i).id.value==id) {
+ return hikes.getAt(i);
+ }
+ }
+}
+
+Backend.getHikes()
+ .then(function(newHikes) {
+ for(var i = 0; i < newHikes.length; i++) {
+ newHikes[i] = CreateObservableHike(newHikes[i]);
+ }
+ hikes.replaceAll(newHikes);
+ })
+ .catch(function(error) {
+ console.log("Couldn't get hikes: " + error);
+ });
+
+module.exports = {
+ hikes: hikes,
+ getHike: getHike
+};
\ No newline at end of file
diff --git a/chapter-7/Pages/EditHikePage.js b/chapter-7/Pages/EditHikePage.js
new file mode 100644
index 0000000..468682c
--- /dev/null
+++ b/chapter-7/Pages/EditHikePage.js
@@ -0,0 +1,20 @@
+var Context = require("Modules/Context");
+
+var hike = this.Parameter.map(function(x) { return Context.getHike(x)});
+
+function cancel() {
+ hike.value.reset();
+ router.goBack();
+}
+
+function save() {
+ hike.value.save();
+ router.goBack();
+}
+
+module.exports = {
+ hike: hike,
+
+ cancel: cancel,
+ save: save
+};
\ No newline at end of file
diff --git a/Pages/EditHikePage.ux b/chapter-7/Pages/EditHikePage.ux
old mode 100755
new mode 100644
similarity index 74%
rename from Pages/EditHikePage.ux
rename to chapter-7/Pages/EditHikePage.ux
index 9071ae0..7287194
--- a/Pages/EditHikePage.ux
+++ b/chapter-7/Pages/EditHikePage.ux
@@ -15,27 +15,27 @@
Name:
-
+ Location:
-
+ Distance (km):
-
+ Rating:
-
+ Comments:
-
+
diff --git a/chapter-7/Pages/HomePage.js b/chapter-7/Pages/HomePage.js
new file mode 100644
index 0000000..2edde6c
--- /dev/null
+++ b/chapter-7/Pages/HomePage.js
@@ -0,0 +1,12 @@
+var Context = require("Modules/Context");
+
+function goToHike(arg) {
+ var hike = arg.data;
+ router.push("editHike", hike.id.value);
+}
+
+module.exports = {
+ hikes: Context.hikes,
+
+ goToHike: goToHike
+};
\ No newline at end of file
diff --git a/Pages/HomePage.ux b/chapter-7/Pages/HomePage.ux
old mode 100755
new mode 100644
similarity index 100%
rename from Pages/HomePage.ux
rename to chapter-7/Pages/HomePage.ux
diff --git a/chapter-7/README.md b/chapter-7/README.md
new file mode 100644
index 0000000..32c179c
--- /dev/null
+++ b/chapter-7/README.md
@@ -0,0 +1,14 @@
+# hikr
+Pronounced "hiker" (/ˈhaɪkə(r)/), hikr is a basic hike-tracking app.
+
+
+
+## basic info
+hikr is an example app case to accompany Fuse's [end-to-end Fuse app tutorial](https://www.fusetools.com/docs/tutorial/tutorial).
+
+_Note: there have been some force-pushes on this repo, so if you've cloned it before the series went live, it's probably a good idea to delete it and clone again._
+
+## license
+This code is licensed under the MIT license (see LICENSE).
+
+The provided video file (`Assets/nature.mp4`) is a modified version of [Graham Uhelski](https://vimeo.com/mankindfilms)'s ["The Valley"](http://mazwai.com/#/videos/220). It is licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/).
diff --git a/chapter-7/hikr.gif b/chapter-7/hikr.gif
new file mode 100644
index 0000000..e26f354
Binary files /dev/null and b/chapter-7/hikr.gif differ
diff --git a/chapter-7/hikr.unoproj b/chapter-7/hikr.unoproj
new file mode 100644
index 0000000..c2636ed
--- /dev/null
+++ b/chapter-7/hikr.unoproj
@@ -0,0 +1,11 @@
+{
+ "RootNamespace":"",
+ "Packages": [
+ "Fuse",
+ "FuseJS"
+ ],
+ "Includes": [
+ "*",
+ "Modules/*.js:Bundle"
+ ]
+}
diff --git a/chapter-8/.gitignore b/chapter-8/.gitignore
new file mode 100644
index 0000000..a0ada99
--- /dev/null
+++ b/chapter-8/.gitignore
@@ -0,0 +1,2 @@
+build/
+.uno/
diff --git a/chapter-8/Assets/background.jpg b/chapter-8/Assets/background.jpg
new file mode 100644
index 0000000..ab46ac8
Binary files /dev/null and b/chapter-8/Assets/background.jpg differ
diff --git a/Assets/nature.mp4 b/chapter-8/Assets/nature.mp4
similarity index 100%
rename from Assets/nature.mp4
rename to chapter-8/Assets/nature.mp4
diff --git a/Components/hikr.Button.ux b/chapter-8/Components/hikr.Button.ux
old mode 100755
new mode 100644
similarity index 83%
rename from Components/hikr.Button.ux
rename to chapter-8/Components/hikr.Button.ux
index d06c16c..8db9669
--- a/Components/hikr.Button.ux
+++ b/chapter-8/Components/hikr.Button.ux
@@ -3,7 +3,7 @@
-
+
diff --git a/chapter-8/Components/hikr.Page.ux b/chapter-8/Components/hikr.Page.ux
new file mode 100644
index 0000000..2b83e7a
--- /dev/null
+++ b/chapter-8/Components/hikr.Page.ux
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/chapter-8/Components/hikr.Text.ux b/chapter-8/Components/hikr.Text.ux
new file mode 100644
index 0000000..71a9616
--- /dev/null
+++ b/chapter-8/Components/hikr.Text.ux
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/chapter-8/Components/hikr.TextBox.ux b/chapter-8/Components/hikr.TextBox.ux
new file mode 100644
index 0000000..281161f
--- /dev/null
+++ b/chapter-8/Components/hikr.TextBox.ux
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/chapter-8/Components/hikr.TextView.ux b/chapter-8/Components/hikr.TextView.ux
new file mode 100644
index 0000000..2939458
--- /dev/null
+++ b/chapter-8/Components/hikr.TextView.ux
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/chapter-8/LICENSE b/chapter-8/LICENSE
new file mode 100644
index 0000000..3ad225c
--- /dev/null
+++ b/chapter-8/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Fuse
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/MainView.ux b/chapter-8/MainView.ux
similarity index 100%
rename from MainView.ux
rename to chapter-8/MainView.ux
diff --git a/chapter-8/Modules/Backend.js b/chapter-8/Modules/Backend.js
new file mode 100644
index 0000000..6e1e33e
--- /dev/null
+++ b/chapter-8/Modules/Backend.js
@@ -0,0 +1,75 @@
+var hikes = [
+ {
+ id: 0,
+ name: "Tricky Trails",
+ location: "Lakebed, Utah",
+ distance: 10.4,
+ rating: 4,
+ comments: "This hike was nice and hike-like. Glad I didn't bring a bike."
+ },
+ {
+ id: 1,
+ name: "Mondo Mountains",
+ location: "Black Hills, South Dakota",
+ distance: 20.86,
+ rating: 3,
+ comments: "Not the best, but would probably do again. Note to self: don't forget the sandwiches next time."
+ },
+ {
+ id: 2,
+ name: "Pesky Peaks",
+ location: "Bergenhagen, Norway",
+ distance: 8.2,
+ rating: 5,
+ comments: "Short but SO sweet!!"
+ },
+ {
+ id: 3,
+ name: "Rad Rivers",
+ location: "Moriyama, Japan",
+ distance: 12.3,
+ rating: 4,
+ comments: "Took my time with this one. Great view!"
+ },
+ {
+ id: 4,
+ name: "Dangerous Dirt",
+ location: "Cactus, Arizona",
+ distance: 19.34,
+ rating: 2,
+ comments: "Too long, too hot. Also that snakebite wasn't very fun."
+ }
+];
+
+function getHikes() {
+ return new Promise(function(resolve, reject) {
+ setTimeout(function() {
+ resolve(hikes);
+ }, 0);
+ });
+}
+
+function updateHike(id, name, location, distance, rating, comments) {
+ return new Promise(function(resolve, reject) {
+ setTimeout(function() {
+ for (var i = 0; i < hikes.length; i++) {
+ var hike = hikes[i];
+ if (hike.id == id) {
+ hike.name = name;
+ hike.location = location;
+ hike.distance = distance;
+ hike.rating = rating;
+ hike.comments = comments;
+ break;
+ }
+ }
+
+ resolve();
+ }, 0);
+ });
+}
+
+module.exports = {
+ getHikes: getHikes,
+ updateHike: updateHike
+};
\ No newline at end of file
diff --git a/chapter-8/Modules/Context.js b/chapter-8/Modules/Context.js
new file mode 100644
index 0000000..4f87298
--- /dev/null
+++ b/chapter-8/Modules/Context.js
@@ -0,0 +1,54 @@
+var Observable = require("FuseJS/Observable");
+var Backend = require("./Backend");
+
+function CreateObservableHike(backendHike) {
+ var obj = {};
+ obj.id = Observable(backendHike.id);
+ obj.name = Observable(backendHike.name);
+ obj.location = Observable(backendHike.location);
+ obj.distance = Observable(backendHike.distance);
+ obj.rating = Observable(backendHike.rating);
+ obj.comments = Observable(backendHike.comments);
+
+ obj.save = function() {
+ Backend.updateHike(obj.id.value, obj.name.value, obj.location.value, obj.distance.value, obj.rating.value, obj.comments.value)
+ .catch(function(error) {
+ console.log("Couldn't update hike: " + obj.id.value);
+ });
+ }
+ obj.reset = function() {
+ obj.id.value = backendHike.id;
+ obj.name.value = backendHike.name;
+ obj.location.value = backendHike.location;
+ obj.distance.value = backendHike.distance;
+ obj.rating.value = backendHike.rating;
+ obj.comments.value = backendHike.comments;
+ }
+ return obj;
+}
+
+var hikes = Observable();
+
+function getHike(id) {
+ for(var i = 0; i < hikes.length; i++) {
+ if(hikes.getAt(i).id.value==id) {
+ return hikes.getAt(i);
+ }
+ }
+}
+
+Backend.getHikes()
+ .then(function(newHikes) {
+ for(var i = 0; i < newHikes.length; i++) {
+ newHikes[i] = CreateObservableHike(newHikes[i]);
+ }
+ hikes.replaceAll(newHikes);
+ })
+ .catch(function(error) {
+ console.log("Couldn't get hikes: " + error);
+ });
+
+module.exports = {
+ hikes: hikes,
+ getHike: getHike
+};
\ No newline at end of file
diff --git a/chapter-8/Pages/EditHikePage.js b/chapter-8/Pages/EditHikePage.js
new file mode 100644
index 0000000..468682c
--- /dev/null
+++ b/chapter-8/Pages/EditHikePage.js
@@ -0,0 +1,20 @@
+var Context = require("Modules/Context");
+
+var hike = this.Parameter.map(function(x) { return Context.getHike(x)});
+
+function cancel() {
+ hike.value.reset();
+ router.goBack();
+}
+
+function save() {
+ hike.value.save();
+ router.goBack();
+}
+
+module.exports = {
+ hike: hike,
+
+ cancel: cancel,
+ save: save
+};
\ No newline at end of file
diff --git a/chapter-8/Pages/EditHikePage.ux b/chapter-8/Pages/EditHikePage.ux
new file mode 100644
index 0000000..7287194
--- /dev/null
+++ b/chapter-8/Pages/EditHikePage.ux
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name:
+
+
+
+
+ Location:
+
+
+
+
+ Distance (km):
+
+
+
+
+ Rating:
+
+
+
+
+ Comments:
+
+
+
+
+
+
\ No newline at end of file
diff --git a/chapter-8/Pages/HomePage.js b/chapter-8/Pages/HomePage.js
new file mode 100644
index 0000000..2edde6c
--- /dev/null
+++ b/chapter-8/Pages/HomePage.js
@@ -0,0 +1,12 @@
+var Context = require("Modules/Context");
+
+function goToHike(arg) {
+ var hike = arg.data;
+ router.push("editHike", hike.id.value);
+}
+
+module.exports = {
+ hikes: Context.hikes,
+
+ goToHike: goToHike
+};
\ No newline at end of file
diff --git a/chapter-8/Pages/HomePage.ux b/chapter-8/Pages/HomePage.ux
new file mode 100644
index 0000000..6787d33
--- /dev/null
+++ b/chapter-8/Pages/HomePage.ux
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+ Recent Hikes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Pages/SplashPage.js b/chapter-8/Pages/SplashPage.js
similarity index 100%
rename from Pages/SplashPage.js
rename to chapter-8/Pages/SplashPage.js
diff --git a/Pages/SplashPage.ux b/chapter-8/Pages/SplashPage.ux
old mode 100755
new mode 100644
similarity index 100%
rename from Pages/SplashPage.ux
rename to chapter-8/Pages/SplashPage.ux
diff --git a/chapter-8/README.md b/chapter-8/README.md
new file mode 100644
index 0000000..32c179c
--- /dev/null
+++ b/chapter-8/README.md
@@ -0,0 +1,14 @@
+# hikr
+Pronounced "hiker" (/ˈhaɪkə(r)/), hikr is a basic hike-tracking app.
+
+
+
+## basic info
+hikr is an example app case to accompany Fuse's [end-to-end Fuse app tutorial](https://www.fusetools.com/docs/tutorial/tutorial).
+
+_Note: there have been some force-pushes on this repo, so if you've cloned it before the series went live, it's probably a good idea to delete it and clone again._
+
+## license
+This code is licensed under the MIT license (see LICENSE).
+
+The provided video file (`Assets/nature.mp4`) is a modified version of [Graham Uhelski](https://vimeo.com/mankindfilms)'s ["The Valley"](http://mazwai.com/#/videos/220). It is licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/).
diff --git a/chapter-8/hikr.gif b/chapter-8/hikr.gif
new file mode 100644
index 0000000..e26f354
Binary files /dev/null and b/chapter-8/hikr.gif differ
diff --git a/chapter-8/hikr.unoproj b/chapter-8/hikr.unoproj
new file mode 100644
index 0000000..c2636ed
--- /dev/null
+++ b/chapter-8/hikr.unoproj
@@ -0,0 +1,11 @@
+{
+ "RootNamespace":"",
+ "Packages": [
+ "Fuse",
+ "FuseJS"
+ ],
+ "Includes": [
+ "*",
+ "Modules/*.js:Bundle"
+ ]
+}