roda-component 0.1.46 → 0.1.47

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a37accc2a509987a4cc84739978f698929bb74cc
4
- data.tar.gz: 1c60476fc587fa408012bf6565c0b142f288a5d3
3
+ metadata.gz: db967a5d53670bf26c1ac99c411d102b9fca65aa
4
+ data.tar.gz: de3138f17fca28020fb597d56c5ec6f309096d38
5
5
  SHA512:
6
- metadata.gz: 113ef63e5eb521f6a4bf282c6f721f506155e55aee3bcfa04e01864af1a135d7327808d70ae334426fa353cf70efd183bbe86843195b6b8c2a63bbf4a6530564
7
- data.tar.gz: 82dae7f4f53186c30cc4e41a81daa1cf58455a95ebccb28aad09ea7e57ceb48cf5a4ca76d7f1cda70e7538e08daadf80ef71470aa73c749d950b7edea3f06725
6
+ metadata.gz: 63552b4280b8e375c8aaff6b1b19e029dae92f550b4cdb0c59718eba1a92b648fc6061fa146d4af83add8171da394d9ca776ed142953e94c04c652f159b0c6b1
7
+ data.tar.gz: 59b16710cff293192b61145ae2d158dd86a4d3cec4f2033e0c595534a4708b6da0ef178b00369bb4deaafcb94e168d3bbfd0c7b62ac17ce4dbe7aa2fb9bc971c
@@ -451,7 +451,7 @@ class Roda
451
451
 
452
452
  def load_component name, options = {}
453
453
  # component_opts[:comp][name] ||= component_opts[:class_name][name].split('::').inject(Object) {|o,c| o.const_get(c)}.new self, options
454
- component_opts[:comp][name]
454
+ component_opts[:comp][name][:class]
455
455
  end
456
456
 
457
457
  def render_fields data, options = {}
@@ -136,9 +136,9 @@ class Roda
136
136
 
137
137
  def component comp
138
138
  if server?
139
- Object.const_get(component_opts[:class_name][comp]).new scope
139
+ Object.const_get(component_opts[:class_name][comp][:class]).new scope
140
140
  else
141
- component_opts[:comp][comp]
141
+ component_opts[:comp][comp][:class]
142
142
  end
143
143
  end
144
144
 
@@ -1,5 +1,5 @@
1
1
  class Roda
2
2
  class Component
3
- VERSION = "0.1.46"
3
+ VERSION = "0.1.47"
4
4
  end
5
5
  end
@@ -104,21 +104,34 @@ class Roda
104
104
  $component_opts[:class_name] = JSON.parse(Base64.decode64('#{class_name}'))
105
105
  end
106
106
 
107
- unless $component_opts[:comp][:"#{comp_name}"]
107
+ if !$component_opts[:comp][:"#{comp_name}"]
108
108
  $component_opts[:faye] ||= {}
109
- $component_opts[:comp][:"#{comp_name}"] = true
109
+ $component_opts[:comp][:"#{comp_name}"] = {cache: {}}
110
110
  `$.getScript("/#{component_opts[:assets_route]}#{file_path}").done(function(){`
111
+ if action != 'false'
112
+ c = $component_opts[:comp][:"#{comp_name}"][:class] = #{comp.class}.new
113
+ else
114
+ c = $component_opts[:comp][:"#{comp_name}"][:class] = #{comp.class}.new(JSON.parse(Base64.decode64('#{options}')))
115
+ end
116
+ c.instance_variable_set(:@_cache, ($component_opts[:comp][:"#{comp_name}"][:cache] = JSON.parse(Base64.decode64('#{cache}'))))
117
+
111
118
  Document.ready? do
112
- if action != 'false'
113
- c = $component_opts[:comp][:"#{comp_name}"] = #{comp.class}.new
114
- else
115
- c = $component_opts[:comp][:"#{comp_name}"] = #{comp.class}.new(JSON.parse(Base64.decode64('#{options}')))
116
- end
117
- c.instance_variable_set(:@_cache, JSON.parse(Base64.decode64('#{cache}')))
118
119
  c.events.trigger_jquery_events
119
120
  c.#{action}(JSON.parse(Base64.decode64('#{options}'))) if action != 'false'
120
121
  end
122
+
123
+ Document.on 'page:load' do
124
+ c.#{action}(JSON.parse(Base64.decode64('#{options}'))) if action != 'false'
125
+ end
121
126
  `}).fail(function(jqxhr, settings, exception){ window.console.log(exception); });`
127
+ elsif $component_opts[:comp][:"#{comp_name}"] && $component_opts[:comp][:"#{comp_name}"][:class]
128
+ if action != 'false'
129
+ c = $component_opts[:comp][:"#{comp_name}"][:class] = #{comp.class}.new
130
+ else
131
+ c = $component_opts[:comp][:"#{comp_name}"][:class] = #{comp.class}.new(JSON.parse(Base64.decode64('#{options}')))
132
+ end
133
+ c.instance_variable_set(:@_cache, $component_opts[:comp][:"#{comp_name}"][:cache])
134
+ c.#{action}(JSON.parse(Base64.decode64('#{options}'))) if action != 'false'
122
135
  end
123
136
  EOF
124
137
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roda-component
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.46
4
+ version: 0.1.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - cj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-19 00:00:00.000000000 Z
11
+ date: 2015-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal