commit: ed08c9177f4c29d8e89a6014c48719c4d54d511f
parent 19f41a5a42389dbfaae01eab7563b499fdf0bcaf
Author: Devine Lu Linvega <aliceffekt@gmail.com>
Date: Thu, 8 Mar 2018 15:16:17 +1300
Removed old parser node
Diffstat:
5 files changed, 19 insertions(+), 50 deletions(-)
diff --git a/index.html b/index.html
@@ -12,7 +12,6 @@
<script src="scripts/nodes/indental.js"></script>
<script src="scripts/nodes/template.js"></script>
<script src="scripts/nodes/dom.js"></script>
- <script src="scripts/nodes/parser.js"></script>
<script src="scripts/templates/recipe.js"></script>
<script src="scripts/templates/ingredient.js"></script>
diff --git a/riven.html b/riven.html
@@ -13,7 +13,6 @@
<script src="scripts/nodes/indental.js"></script>
<script src="scripts/nodes/template.js"></script>
<script src="scripts/nodes/dom.js"></script>
- <script src="scripts/nodes/parser.js"></script>
<script src="scripts/templates/recipe.js"></script>
<script src="scripts/templates/ingredient.js"></script>
diff --git a/scripts/graph.js b/scripts/graph.js
@@ -12,27 +12,26 @@ function graph()
])
Ø("assoc").mesh({x:19,y:0},[
- Ø("parser").create({x:5,y:2},ParserNode),
+ Ø("template").create({x:5,y:2},TemplateNode),
Ø("recipe").create({x:2,y:8},RecipeTemplate),
Ø("ingredient").create({x:5,y:8},IngredientTemplate),
Ø("page").create({x:8,y:8},PageTemplate),
])
Ø("view").mesh({x:32,y:0},[
- Ø("template").create({x:2,y:2},TemplateNode),
- Ø("main").create({x:14,y:7},DomNode),
+ Ø("main").create({x:2,y:2},DomNode),
- Ø("header").create({x:2,y:12},DomNode),
- Ø("logo").create({x:2,y:17},DomNode),
- Ø("search").create({x:6,y:17},DomNode),
- Ø("menu").create({x:10,y:17},DomNode),
+ Ø("header").create({x:2,y:8},DomNode),
+ Ø("logo").create({x:2,y:14},DomNode),
+ Ø("search").create({x:6,y:14},DomNode),
+ Ø("menu").create({x:10,y:14},DomNode),
- Ø("body").create({x:14,y:12},DomNode),
- Ø("core").create({x:14,y:17},DomNode),
- Ø("suggestions").create({x:17,y:17},DomNode),
+ Ø("body").create({x:14,y:8},DomNode),
+ Ø("core").create({x:14,y:14},DomNode),
+ Ø("related").create({x:17,y:14},DomNode),
- Ø("footer").create({x:10,y:12},DomNode),
+ Ø("footer").create({x:10,y:8},DomNode),
])
// Model
@@ -40,16 +39,15 @@ function graph()
Ø("database").syphon(["recipes","ingredients","pages"])
// Assoc
- Ø("parser").syphon(["recipe","ingredient","page"])
- Ø("parser").connect("template")
+ Ø("template").syphon(["recipe","ingredient","page"])
- Ø("template").bind("main")
+ Ø("template").connect("main")
Ø("main").bind(["header","body","footer"])
- Ø("body").bind(["core","suggestions"])
+ Ø("body").bind(["core","related"])
Ø("header").bind(["logo","search","menu"])
Ø("query").connect("router")
- Ø("router").connect("parser")
+ Ø("router").connect("template")
Ø("query").bang()
}
diff --git a/scripts/nodes/parser.js b/scripts/nodes/parser.js
@@ -1,14 +0,0 @@
-function ParserNode(id,rect)
-{
- Node.call(this,id,rect);
-
- this.glyph = NODE_GLYPHS.router
-
- this.receive = function(q)
- {
- this.label = `parser=${q.name}`
- var assoc = this.signal(q.type.slice(0, -1));
-
- this.send(assoc)
- }
-}-
\ No newline at end of file
diff --git a/scripts/nodes/template.js b/scripts/nodes/template.js
@@ -8,24 +8,12 @@ function TemplateNode(id,rect)
this.receive = function(q)
{
- console.log(q)
- // var template = this.signal(q.type.slice(0, -1));
- // var related_template = this.signal("related");
-
- // console.log(related_template)
- // var dom = {
- // header:{
- // search:q.name
- // },
- // body:{
- // core: template.answer(q),
- // related: "qq"
- // },
- // footer:"hello"
- // }
- // this.send({main:dom})
+ // Select the right signal
+ var assoc = this.signal(q.type.slice(0, -1));
+
+ this.send({main:assoc.answer(q)})
// // Install Dom
- // this.signal("main").request()
+ this.signal("main").request()
}
}
\ No newline at end of file