social_rails 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/app/assets/javascripts/app.js +4 -1
- data/app/assets/javascripts/social_rails/social-rails.js +9 -27
- data/lib/social_rails/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d921eab8387ce535949dc3f25f1e4d01459246c0
|
4
|
+
data.tar.gz: 14457fc0fbb6bd5166bda3612f2b4dab3aa791ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
12
|
-
|
13
|
-
var
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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) {
|
data/lib/social_rails/version.rb
CHANGED
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.
|
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-
|
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.
|
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.
|