roda-component 0.1.52 → 0.1.53
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/roda/component/version.rb +1 -1
- data/lib/roda/component.rb +7 -1
- data/lib/roda/plugins/component.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41c126a7621dc0b571681e4ddd74ff0c35c13e89
|
4
|
+
data.tar.gz: 1255952e2020d8b3d54b536cbc96f52280ac7b43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6325870641c04381f926fee8a2153df4aebcc819aa2a75618866cba97e40a26c2ad8fd09abbf4d0a1f3487c78095e6bb120b8a8c419858f9eeabf91f310b32af
|
7
|
+
data.tar.gz: 5740196694645b1365fd931074d86d5f7cac36f414c301d74764fa54987b215d3311354a985aa31f17e901e18416ce4beb469118418073b29006b903a360ae23
|
data/lib/roda/component.rb
CHANGED
@@ -124,7 +124,7 @@ class Roda
|
|
124
124
|
end
|
125
125
|
|
126
126
|
class << self
|
127
|
-
attr_accessor :_name
|
127
|
+
attr_accessor :_name, :_on_server_methods
|
128
128
|
|
129
129
|
def file_location
|
130
130
|
@_file_location
|
@@ -162,12 +162,16 @@ class Roda
|
|
162
162
|
end
|
163
163
|
|
164
164
|
def on_server &block
|
165
|
+
@_on_server_methods ||= []
|
166
|
+
|
165
167
|
if server?
|
166
168
|
m = Module.new(&block)
|
167
169
|
|
168
170
|
yield
|
169
171
|
|
170
172
|
m.public_instance_methods(false).each do |meth|
|
173
|
+
@_on_server_methods << meth.to_s
|
174
|
+
|
171
175
|
alias_method :"original_#{meth}", :"#{meth}"
|
172
176
|
define_method "#{meth}" do |*args, &blk|
|
173
177
|
o_name = "original_#{meth}"
|
@@ -185,6 +189,8 @@ class Roda
|
|
185
189
|
m = Module.new(&block)
|
186
190
|
|
187
191
|
m.public_instance_methods(false).each do |meth|
|
192
|
+
@_on_server_methods << meth.to_s
|
193
|
+
|
188
194
|
define_method "#{meth}" do |*args, &blk|
|
189
195
|
name = self.class._name
|
190
196
|
# event_id = "comp-event-#{$faye.generate_id}"
|
@@ -117,11 +117,11 @@ class Roda
|
|
117
117
|
|
118
118
|
Document.ready? do
|
119
119
|
c.events.trigger_jquery_events
|
120
|
-
c.#{action}(JSON.parse(Base64.decode64('#{options}'))) if action != 'false'
|
120
|
+
c.#{action}(JSON.parse(Base64.decode64('#{options}'))) if !(c.class._on_server_methods || []).include?('#{action}') && action != 'false'
|
121
121
|
end
|
122
122
|
|
123
123
|
Document.on 'page:load' do
|
124
|
-
c.#{action}(JSON.parse(Base64.decode64('#{options}'))) if action != 'false'
|
124
|
+
c.#{action}(JSON.parse(Base64.decode64('#{options}'))) if !(c.class._on_server_methods || []).include?('#{action}') && action != 'false'
|
125
125
|
end
|
126
126
|
`}).fail(function(jqxhr, settings, exception){ window.console.log(exception); });`
|
127
127
|
elsif $component_opts[:comp][:"#{comp_name}"] && $component_opts[:comp][:"#{comp_name}"][:class]
|
@@ -131,7 +131,7 @@ class Roda
|
|
131
131
|
c = $component_opts[:comp][:"#{comp_name}"][:class] = #{comp.class}.new(JSON.parse(Base64.decode64('#{options}')))
|
132
132
|
end
|
133
133
|
c.instance_variable_set(:@_cache, $component_opts[:comp][:"#{comp_name}"][:cache])
|
134
|
-
c.#{action}(JSON.parse(Base64.decode64('#{options}'))) if action != 'false'
|
134
|
+
c.#{action}(JSON.parse(Base64.decode64('#{options}'))) if !(c.class._on_server_methods || []).include?('#{action}') && action != 'false'
|
135
135
|
end
|
136
136
|
EOF
|
137
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.
|
4
|
+
version: 0.1.53
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cj
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|