wedge 0.1.78 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wedge/component.rb +16 -4
- data/lib/wedge/version.rb +1 -1
- data/lib/wedge.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: 3cc2ac92d6123dd277d83d4fab758ba933fe8192
|
4
|
+
data.tar.gz: 88b67e5949b1f3ee451f9ff9ec7fbe0dd24f4fed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f49f7b7ce844c662393f0a850d7ba48827167bd2f16f13a002e0f6f63a11d14e6135d96ba28238c2ec400e5eccfd9b3a5a1a762f2a3ae16943b797fd017b13e
|
7
|
+
data.tar.gz: 9f051c6e624981cdc1d65459216d4182e01081f67944215d25bf6fceb8ed1c0a729a51deddc24f0286853a21873f91e8211280c95cb7a41f8bb1d4b9bae05608
|
data/lib/wedge/component.rb
CHANGED
@@ -205,7 +205,11 @@ class Wedge
|
|
205
205
|
|
206
206
|
res = JSON.from_object(`response`)
|
207
207
|
|
208
|
-
blk.call res[:body], res
|
208
|
+
results = blk.call res[:body], res
|
209
|
+
|
210
|
+
# Element.trigger 'wedge:call-finished'
|
211
|
+
|
212
|
+
results
|
209
213
|
end
|
210
214
|
else
|
211
215
|
data = {
|
@@ -377,9 +381,17 @@ class Wedge
|
|
377
381
|
)
|
378
382
|
|
379
383
|
compiled_opts = Base64.encode64 client_data.to_json
|
380
|
-
|
381
|
-
|
382
|
-
|
384
|
+
|
385
|
+
begin
|
386
|
+
javascript = <<-JS
|
387
|
+
Wedge.javascript('#{config.path}', JSON.parse(Base64.decode64('#{compiled_opts}')), '#{javascript_path(config.path)}')
|
388
|
+
JS
|
389
|
+
rescue
|
390
|
+
javascript = <<-JS
|
391
|
+
Wedge.javascript('#{config.path}', JSON.parse(Base64.decode64('#{compiled_opts}')))
|
392
|
+
JS
|
393
|
+
end
|
394
|
+
|
383
395
|
"<script>#{Opal.compile(javascript)}</script>"
|
384
396
|
end
|
385
397
|
alias_method :javscript, :wedge_javascript
|
data/lib/wedge/version.rb
CHANGED
data/lib/wedge.rb
CHANGED
@@ -203,7 +203,7 @@ class Wedge
|
|
203
203
|
end
|
204
204
|
|
205
205
|
# Return the opal javascript.
|
206
|
-
def javascript(path_name = 'wedge', options = {})
|
206
|
+
def javascript(path_name = 'wedge', options = {}, url = false)
|
207
207
|
path_name = path_name.to_s
|
208
208
|
|
209
209
|
if server?
|
@@ -216,13 +216,13 @@ class Wedge
|
|
216
216
|
cache = options[:cache_assets]
|
217
217
|
|
218
218
|
if !Wedge.config.debug
|
219
|
-
url
|
219
|
+
url ||= "#{Wedge.assets_url_with_host}/#{options[:path]}.js"
|
220
220
|
|
221
221
|
`jQuery.ajax({ url: url, dataType: "script", cache: cache }).done(function() {`
|
222
222
|
trigger_javascript_loaded path_name, options
|
223
223
|
`}).fail(function(jqxhr, settings, exception){ window.console.log(exception); })`
|
224
224
|
else
|
225
|
-
url
|
225
|
+
url ||= "#{Wedge.assets_url_with_host}/wedge/list_assets.call"
|
226
226
|
payload = { path_name: path_name}
|
227
227
|
headers = {
|
228
228
|
'X-CSRF-TOKEN' => Element.find('meta[name=_csrf]').attr('content'),
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wedge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cj
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal-wedge
|