volt 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Readme.md +8 -1
- data/VERSION +1 -1
- data/lib/volt/reactive/object_tracking.rb +0 -1
- data/lib/volt/server/template_parser.rb +2 -1
- data/lib/volt/templates/channel.rb +0 -1
- data/lib/volt/templates/page.rb +0 -1
- data/lib/volt/templates/reactive_template.rb +1 -0
- data/lib/volt/templates/template_renderer.rb +11 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c68b3acc9f83d53f4bc696e40646086e44035c1c
|
4
|
+
data.tar.gz: 6b6ae0d67023515a38e737bced141fa056bc0eb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e78bd6f60875a7295d9d826430eca58d7d0490cecedecab80b5b58b914971b6c94958d0a8f77854bb542128f55fa3255e94c77f78305f0f49f812cbc62aee45
|
7
|
+
data.tar.gz: 32c5dbacd53d2e20ed40787434b7674fb840e966944d249d0837a2858129afea9f18977cb74ed20e5d8ed104f65a37a381f07fc100eba99467776b83b9665465
|
data/Readme.md
CHANGED
@@ -34,4 +34,11 @@ Everyone wishes that we could predict the scope and required features for each p
|
|
34
34
|
- subtemplate
|
35
35
|
- template
|
36
36
|
- controller
|
37
|
-
- component
|
37
|
+
- component
|
38
|
+
|
39
|
+
# Components
|
40
|
+
|
41
|
+
Apps are made up of Components. Each folder under app/ is a component. When you visit a route, it loads all of the files in the component on the front end, so new pages within the component can be rendered on the front end. If a url is visited that routes to a different component, the request will be loaded as a normal page load and all of that components files will be loaded. You can think of components as the "reload boundry" between sections of your app.
|
42
|
+
|
43
|
+
# Controls
|
44
|
+
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
@@ -2,7 +2,6 @@
|
|
2
2
|
module ObjectTracking
|
3
3
|
def __setup_tracking(key, value)
|
4
4
|
if value.reactive?
|
5
|
-
puts "Value: #{value.inspect} - #{key}"
|
6
5
|
# TODO: We should build this in so it fires just for the current index.
|
7
6
|
# Currently this is a big performance hit.
|
8
7
|
chain_listener = event_chain.add_object(value.reactive_manager) do |event, *args|
|
@@ -219,7 +219,7 @@ class Template
|
|
219
219
|
full_template_path = "#{@template_parser.template_path}/#{section_name}/#{template_name}"
|
220
220
|
@binding_number += 1
|
221
221
|
|
222
|
-
attribute_template = Template.new(@template_parser, section_name, Nokogiri::HTML::DocumentFragment.parse(content))
|
222
|
+
attribute_template = Template.new(@template_parser, "#{section_name}/#{template_name}", Nokogiri::HTML::DocumentFragment.parse(content))
|
223
223
|
@template_parser.add_template("#{section_name}/#{template_name}", attribute_template)
|
224
224
|
attribute_template.start_walk
|
225
225
|
attribute_template.pull_closed_block_scopes
|
@@ -433,6 +433,7 @@ class TemplateParser
|
|
433
433
|
end
|
434
434
|
|
435
435
|
def add_template(name, template)
|
436
|
+
raise "Already defined at #{@template_path + '/' + name}" if @templates[@template_path + '/' + name]
|
436
437
|
@templates[@template_path + '/' + name] = template
|
437
438
|
end
|
438
439
|
|
data/lib/volt/templates/page.rb
CHANGED
@@ -2,6 +2,7 @@ class ReactiveTemplate
|
|
2
2
|
include Events
|
3
3
|
|
4
4
|
def initialize(context, template_path)
|
5
|
+
# puts "New Reactive Template: #{context.inspect} - #{template_path.inspect}"
|
5
6
|
@template_path = template_path
|
6
7
|
@target = AttributeTarget.new
|
7
8
|
@template = TemplateRenderer.new(@target, context, "main", template_path)
|
@@ -25,6 +25,10 @@ class TemplateRenderer < BaseBinding
|
|
25
25
|
@sub_bindings << binding.call(target, context, id)
|
26
26
|
end
|
27
27
|
end
|
28
|
+
|
29
|
+
if @context.respond_to?(:dom_ready)
|
30
|
+
@context.dom_ready
|
31
|
+
end
|
28
32
|
|
29
33
|
end
|
30
34
|
|
@@ -41,7 +45,14 @@ class TemplateRenderer < BaseBinding
|
|
41
45
|
end
|
42
46
|
|
43
47
|
@sub_bindings = []
|
48
|
+
|
44
49
|
super
|
50
|
+
|
51
|
+
# Let the controller know we removed
|
52
|
+
if @context.respond_to?(:dom_removed)
|
53
|
+
@context.dom_removed
|
54
|
+
end
|
55
|
+
|
45
56
|
end
|
46
57
|
|
47
58
|
def remove_anchors
|