nexaas-async-collector 3.3.2 → 3.3.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 842bb99f8a3e92981689ee7978d4fd93b39e62294053ddc93770266378137b52
|
4
|
+
data.tar.gz: 00b1fefc5c70c5cc67edd3b235529e65ec4a20907f493a38c458e09b5da9162c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5812d59457d8b3a630838ef360e82c10fcd287edc99d028c7ec81bcc13a9afaf22817787be83ad469f7e7a52a689c500faf52fdadf382f59da8393c7d04346b3
|
7
|
+
data.tar.gz: 2fefb161bc113d27519ab3fd285f61e6075d12fef116a0bae7655cd60c7812484b0ea3fb737737b510f36050418760c1b57520c21018034ede7d2b15038abeb0
|
@@ -1,16 +1,44 @@
|
|
1
1
|
<script type="text/javascript" id="js-nexaas-async-collector-<%= unique_id %>">
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
}
|
11
|
-
|
12
|
-
|
13
|
-
|
2
|
+
(function registerCollector(id, path) {
|
3
|
+
window.nexaas_async_collector = window.nexaas_async_collector || {};
|
4
|
+
|
5
|
+
var collector = window.nexaas_async_collector[id];
|
6
|
+
var isCollectorPresent = !!collector;
|
7
|
+
|
8
|
+
if (isCollectorPresent) {
|
9
|
+
clearInterval(collector.interval);
|
10
|
+
}
|
11
|
+
|
12
|
+
var requestContent = function() {
|
13
|
+
$.ajax({
|
14
|
+
url: path,
|
15
|
+
dataType: 'script',
|
16
|
+
data: { unique_id: id }
|
17
|
+
})
|
18
|
+
};
|
19
|
+
|
20
|
+
var removeLoader = function(self) {
|
21
|
+
clearInterval(self.interval);
|
22
|
+
$('#js-nexaas-async-collector-loading-' + id).remove();
|
23
|
+
$('#js-nexaas-async-collector-style-' + id).remove();
|
24
|
+
};
|
25
|
+
|
26
|
+
window.nexaas_async_collector[id] = {
|
27
|
+
interval: setInterval(requestContent, 3000),
|
28
|
+
|
29
|
+
collectHTML: function(html) {
|
30
|
+
removeLoader(this);
|
31
|
+
var $collector = $('#js-nexaas-async-collector-' + id);
|
32
|
+
$collector.parent().append(html);
|
33
|
+
$collector.remove();
|
34
|
+
},
|
35
|
+
|
36
|
+
collectUrl: function(url) {
|
37
|
+
removeLoader(this);
|
38
|
+
window.location.href = url;
|
39
|
+
}
|
40
|
+
};
|
41
|
+
})('<%= unique_id %>', '<%= nexaas_async_collector.async_resource_path(collect_id) %>');
|
14
42
|
</script>
|
15
43
|
|
16
44
|
<%= render partial: "nexaas/async/collector/async_resource/loading", locals: { unique_id: unique_id } %>
|
@@ -1,13 +1,11 @@
|
|
1
1
|
<% if @result.content_is_ready? %>
|
2
|
-
clearInterval(window.nexaas_async_interval);
|
3
|
-
|
4
2
|
<% if @result.is_file? %>
|
5
|
-
|
6
|
-
|
3
|
+
window.nexaas_async_collector['<%= @unique_id %>'].collectUrl(
|
4
|
+
'<%= nexaas_async_collector.async_resource_path(params[:id], format: @result.extension) %>'
|
5
|
+
);
|
7
6
|
<% else %>
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
$('#js-nexaas-async-collector-style-<%= @unique_id %>').remove()
|
7
|
+
window.nexaas_async_collector['<%= @unique_id %>'].collectHTML(
|
8
|
+
'<%= escape_javascript(@result.content.force_encoding('UTF-8').html_safe) %>'
|
9
|
+
);
|
12
10
|
<% end %>
|
13
11
|
<% end %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nexaas-async-collector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduardo Hertz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -92,14 +92,14 @@ dependencies:
|
|
92
92
|
requirements:
|
93
93
|
- - '='
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: 0.
|
95
|
+
version: 0.7.0
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - '='
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: 0.
|
102
|
+
version: 0.7.0
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: byebug
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -175,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
175
|
version: '0'
|
176
176
|
requirements: []
|
177
177
|
rubyforge_project:
|
178
|
-
rubygems_version: 2.6
|
178
|
+
rubygems_version: 2.7.6
|
179
179
|
signing_key:
|
180
180
|
specification_version: 4
|
181
181
|
summary: Collect and generate async content.
|