summaryrefslogtreecommitdiff
path: root/js/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/app.js')
-rw-r--r--js/app.js52
1 files changed, 52 insertions, 0 deletions
diff --git a/js/app.js b/js/app.js
new file mode 100644
index 0000000..847b9a7
--- /dev/null
+++ b/js/app.js
@@ -0,0 +1,52 @@
+var config = {};
+config.images = [];
+
+function app(){};
+app.init = function(){
+ app.load();
+}
+app.load = function(){
+ app.loader = new Loader ();
+ app.loader.register("loading");
+
+ app.flatfiles = [
+ new Flatfile ("vegan", "products.default.txt")
+ , new Flatfile ("dairy", "products.dairy.txt")
+ , new Flatfile ("esoteric", "products.esoteric.txt")
+ , new Flatfile ("meat", "products.meat.txt")
+ , new Flatfile ("seafood", "products.seafood.txt")
+ , new Flatfile ("weird", "products.esoteric.txt")
+ , new Flatfile ("techniques", "techniques.txt")
+ , new Flatfile ("preparations", "preparations.txt")
+ ];
+
+ app.loader.ready("loading");
+}
+
+app.ready = function(){
+ console.log("READY");
+ app.bind();
+ app.generate();
+}
+
+app.bind = function(){
+ $("#generate").click(app.generate);
+}
+
+app.generate = function(){
+ window.products = [].concat(vegan,meat,dairy,seafood);
+ var texts = [];
+ for (var i = 0; i < courses.length; i++) {
+ var courseName = courses[i][0];
+ var text = "<h2>" + courseName + "</h2>";
+ for (var j = 1; j < courses[i].length; j++) {
+ text += "<p>" + course(courses[i][j]) + "</p>";
+ }
+ texts.push(text);
+ }
+ console.log(texts)
+ $("#result").html(texts.join(""));
+}
+
+
+