diff options
| author | Jules Laplace <jules@okfoc.us> | 2013-08-02 17:21:32 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2013-08-02 17:21:32 -0400 |
| commit | 0003c072cb83f48386c5e264d86b0aa3a9eaa20d (patch) | |
| tree | bd9a40fd1c387cc054b03ec1376927e7027d330f /js/app.js | |
| parent | d4d9fc9513925397d71b4ac1ed3426fd6e7dc0e7 (diff) | |
app
Diffstat (limited to 'js/app.js')
| -rw-r--r-- | js/app.js | 52 |
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("")); +} + + + |
