social_rails 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: 60ef8763a3b5568a98a7a83c8d8be31effb2a7ee
4
- data.tar.gz: 1a438a17ccb3c1e2148168a400da3f481639ddf4
3
+ metadata.gz: d921eab8387ce535949dc3f25f1e4d01459246c0
4
+ data.tar.gz: 14457fc0fbb6bd5166bda3612f2b4dab3aa791ed
5
5
  SHA512:
6
- metadata.gz: d0f6bd9b924ad5ec6811486874b1fbbb55d7e1ace14b3e19cd62813d627a18696ca7343399d61dff93fdd5c6a66614583921aee9594074ffef5e39bf6b0ff860
7
- data.tar.gz: bef7740c827c635620dd9003b5ee551274d47e1cf77573f447d0511c7b0fd9b61f8ed540f4465de4e50a5c965408be7ee829353e2b3f097ac0f910ca276eb10b
6
+ metadata.gz: 91dadfb175bfde91df14ab96d3060e23da368bd9fec08fc94a2a05270838a28f5a5c0c4c8c7e2250e007bcf68119bb7e8794359493c15da28bf5af72667787f6
7
+ data.tar.gz: edecc19819ad39acad04675ef33102de7867f3a3550131f63742d55de1f515eadd38036b5a552a5d40973a228a5ba48b54c1db44150e4e09de4c9d0c8ae2e74a
data/README.md CHANGED
@@ -39,6 +39,8 @@ countdown #15.minutes by default
39
39
  public: {
40
40
  post_count: # 1 by default
41
41
  max_characters: # 0 by default
42
+ refresh: # false by default
43
+ refresh_time: # 15.minutes.in_milliseconds by default
42
44
  }
43
45
  ```
44
46
 
@@ -63,6 +65,8 @@ Options must be an Hash of theses available options:
63
65
  ``` ruby
64
66
  post_count # 1 by default
65
67
  max_characters # 0 by default
68
+ refresh # false by default
69
+ refresh_time # 900000 (15 minutes) in milliseconds
66
70
  ```
67
71
 
68
72
  Use the following generator command to override views.
@@ -6,7 +6,10 @@ window.SocialRails = () => {
6
6
  twitter: '/social/twitter'
7
7
  }
8
8
 
9
- for (const placeholder of document.getElementsByClassName('js-social')) {
9
+ const placeholders = document.getElementsByClassName('js-social')
10
+
11
+ for( let i = 0, len = placeholders.length; i < len; i++ ) {
12
+ const placeholder = placeholders[i]
10
13
  const namespace = placeholder.dataset.namespace
11
14
  const node = document.getElementById(`social-${namespace}`)
12
15
  const options = JSON.parse(node.dataset.options)
@@ -8,33 +8,15 @@ window.SocialRails = function () {
8
8
  twitter: '/social/twitter'
9
9
  };
10
10
 
11
- var _iteratorNormalCompletion = true;
12
- var _didIteratorError = false;
13
- var _iteratorError = undefined;
14
-
15
- try {
16
- for (var _iterator = document.getElementsByClassName('js-social')[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
17
- var placeholder = _step.value;
18
-
19
- var namespace = placeholder.dataset.namespace;
20
- var node = document.getElementById('social-' + namespace);
21
- var options = JSON.parse(node.dataset.options);
22
- node.dataset.options = [];
23
- update_social_content(placeholder, { namespace: namespace, node: node, options: options });
24
- }
25
- } catch (err) {
26
- _didIteratorError = true;
27
- _iteratorError = err;
28
- } finally {
29
- try {
30
- if (!_iteratorNormalCompletion && _iterator.return) {
31
- _iterator.return();
32
- }
33
- } finally {
34
- if (_didIteratorError) {
35
- throw _iteratorError;
36
- }
37
- }
11
+ var placeholders = document.getElementsByClassName('js-social');
12
+
13
+ for (var i = 0, len = placeholders.length; i < len; i++) {
14
+ var placeholder = placeholders[i];
15
+ var namespace = placeholder.dataset.namespace;
16
+ var node = document.getElementById('social-' + namespace);
17
+ var options = JSON.parse(node.dataset.options);
18
+ node.dataset.options = [];
19
+ update_social_content(placeholder, { namespace: namespace, node: node, options: options });
38
20
  }
39
21
 
40
22
  function update_social_content(placeholder, _ref) {
@@ -1,3 +1,3 @@
1
1
  module SocialRails
2
- VERSION = '3.0.0'
2
+ VERSION = '3.0.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social_rails
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
  - Francis G
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-17 00:00:00.000000000 Z
11
+ date: 2018-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  version: '0'
139
139
  requirements: []
140
140
  rubyforge_project:
141
- rubygems_version: 2.6.14
141
+ rubygems_version: 2.5.2
142
142
  signing_key:
143
143
  specification_version: 4
144
144
  summary: Ease the pain of integrating social media posts in a Rails app.