nexaas-async-collector 3.0.0 → 3.0.1

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
2
  SHA1:
3
- metadata.gz: 12f9ccbad9f69f3bf63c3f6621b043fe9f954505
4
- data.tar.gz: 1deada69697529760b2a83fee48ef2ec1afcd4d8
3
+ metadata.gz: ee2109580d4539bc01aa2015e35fdb66a03a5e47
4
+ data.tar.gz: b36924123c2122b0fec86735195899cb0fa70b2c
5
5
  SHA512:
6
- metadata.gz: 4e13fae56cd4af7efa9b635caae9ae40c78eec06b98ce3f5d49a4b95f5686549864806f3a7595066cc42f87c91111305a24e720388ba1fe0ffdc827e8f3eb8d7
7
- data.tar.gz: d7920b28cdd1be4de6ebe10bb9973410e9f33e5a69c47d0178e0ebc8a48bf77847f57811fde3e62bb92749a5361f60335f09a6a30058e6c473240c2163573000
6
+ metadata.gz: 965dd0712b7f5d4e6cc82be1a1ccbf256a74a95253ab155759f8934e84d92fbcefea0fc673d23e98847330867b3ecf52f4a55a6ca3204c61beb449b783c76169
7
+ data.tar.gz: abbae053baa51b8313e474544a56bcfcdd448f98539244fb330ef7fb11de8121e9fa3d98ddd0ce809c6f5531dbacfeb3ae42d78de39a1d8a56e9c0e28c3343c3
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  Agnostic collector and generator of async content for Rails apps. Used in production in a few [Nexaas](www.nexaas.com) systems.
9
9
 
10
- This gems is compatible with Ruby 2.1+ and Rails 3.2+.
10
+ This gems is compatible with Ruby 2.3+ and Rails 3.2+.
11
11
 
12
12
  ## Prerequisites
13
13
  The prerequisites of this project are:
@@ -6,6 +6,7 @@ module Nexaas
6
6
  class AsyncResourceController < ApplicationController
7
7
  def show
8
8
  @result = Result.new(collector_scope.id, params[:id])
9
+ @unique_id = params[:unique_id]
9
10
  respond_to { |f| f.js }
10
11
  end
11
12
 
@@ -16,7 +16,7 @@ module Nexaas
16
16
  validate_options(opts)
17
17
  opts.merge!({ collect_id: collect_id })
18
18
  AsyncResourceJob.perform_async(opts)
19
- render(partial: 'nexaas/async/collector/async_resource/show')
19
+ render(partial: 'nexaas/async/collector/async_resource/show', locals: { unique_id: SecureRandom.hex })
20
20
  end
21
21
 
22
22
  # Rails 4.x does not add this helper automatically as Rails 5.X and 3.X does. So we had to created it to keep
@@ -1,4 +1,4 @@
1
- <style type="text/css">
1
+ <style type="text/css" id="js-nexaas-async-collector-style-<%= unique_id %>">
2
2
  .nexaas-async-collector-loading img {
3
3
  vertical-align: middle;
4
4
  }
@@ -8,7 +8,7 @@
8
8
  }
9
9
  </style>
10
10
 
11
- <div class="nexaas-async-collector-loading">
11
+ <div class="nexaas-async-collector-loading" id="js-nexaas-async-collector-loading-<%= unique_id %>">
12
12
  <%= image_tag 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHdpZHRoPSIyMnB4IiBoZWlnaHQ9IjIycHgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIiBjbGFzcz0idWlsLXNwaW4iPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiBmaWxsPSJub25lIiBjbGFzcz0iYmsiPjwvcmVjdD48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1MCA1MCkiPjxnIHRyYW5zZm9ybT0icm90YXRlKDApIHRyYW5zbGF0ZSgzNCAwKSI+PGNpcmNsZSBjeD0iMCIgY3k9IjAiIHI9IjYiIGZpbGw9IiMwMDAiPjxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGZyb209IjEiIHRvPSIwLjEiIGJlZ2luPSItMC44N3MiIGR1cj0iMXMiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+PGFu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NpdHkiIGZyb209IjEiIHRvPSIwLjEiIGJlZ2luPSItMHMiIGR1cj0iMXMiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+PGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJzY2FsZSIgZnJvbT0iMS41IiB0bz0iMSIgYmVnaW49Ii0wcyIgZHVyPSIxcyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiPjwvYW5pbWF0ZVRyYW5zZm9ybT48L2NpcmNsZT48L2c+PC9nPjwvc3ZnPg==' %>
13
13
  <%= I18n.t('nexaas.async.collector.loading') %>
14
14
  </div>
@@ -1,12 +1,13 @@
1
- <script type="text/javascript" id="js-nexaas-async-collector">
1
+ <script type="text/javascript" id="js-nexaas-async-collector-<%= unique_id %>">
2
2
  var requestContent = function() {
3
3
  $.ajax({
4
4
  url: '<%= nexaas_async_collector.async_resource_path(@collect_id) %>',
5
- dataType: 'script'
5
+ dataType: 'script',
6
+ data: { unique_id: '<%= unique_id %>' }
6
7
  })
7
8
  }
8
9
 
9
10
  window.nexaas_async_interval = setInterval(requestContent, 3000);
10
11
  </script>
11
12
 
12
- <%= render partial: "nexaas/async/collector/async_resource/loading" %>
13
+ <%= render partial: "nexaas/async/collector/async_resource/loading", locals: { unique_id: unique_id } %>
@@ -1,5 +1,7 @@
1
1
  <% if @result.content_is_ready? %>
2
2
  clearInterval(window.nexaas_async_interval);
3
- $('.nexaas-async-collector-loading').remove();
4
- $('#js-nexaas-async-collector').parent().append("<%= escape_javascript(@result.content.html_safe) %>");
3
+ $('#js-nexaas-async-collector-loading-<%= @unique_id %>').remove();
4
+ $('#js-nexaas-async-collector-<%= @unique_id %>').parent().append("<%= escape_javascript(@result.content.html_safe) %>");
5
+ $('#js-nexaas-async-collector-<%= @unique_id %>').remove()
6
+ $('#js-nexaas-async-collector-style-<%= @unique_id %>').remove()
5
7
  <% end %>
@@ -1,7 +1,7 @@
1
1
  module Nexaas
2
2
  module Async
3
3
  module Collector
4
- VERSION = '3.0.0'
4
+ VERSION = '3.0.1'
5
5
  end
6
6
  end
7
7
  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.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo Hertz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-14 00:00:00.000000000 Z
11
+ date: 2017-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails