foreign_office 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/foreign_office/foreign_office_helper.rb +9 -3
- data/lib/foreign_office/version.rb +1 -1
- 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: e607b876892172ef11ee3dfc659ba5834ce1ec91
|
4
|
+
data.tar.gz: 539b25bdc3f9d4cc9460c76cfa93409231e23042
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cff5a2eaa2a31204e457c4aa4d4d8afcd90b5337c4ef38c104e7f4b089395d4a611790652c97c7bcb5d21d8c10d10e96b2e450b5655db80e6f5ad6003a99c840
|
7
|
+
data.tar.gz: a9f16d86b53bbc089ed848a50d7ae0396c232c9b352fc8f7685d0414bd2e6ece9970d01530b45494a2d2f0c4df6dfc59c76592cec3b874078c4329e2ee149ee3
|
@@ -1,20 +1,26 @@
|
|
1
1
|
module ForeignOffice
|
2
2
|
module ForeignOfficeHelper
|
3
|
-
def listener_attrs(resource, key, reveal_hide: false)
|
3
|
+
def listener_attrs(resource, key, reveal_hide: false, endpoint: nil, trigger: nil)
|
4
4
|
data_attrs = "data-listener=true data-channel=#{resource.class.name}#{resource.id} data-key=#{key}"
|
5
5
|
data_attrs += " data-reveal-hide=true" if reveal_hide
|
6
|
+
data_attrs += " data-endpoint=#{endpoint}" if endpoint
|
7
|
+
data_attrs += " data-trigger-on-message=true" if trigger
|
6
8
|
data_attrs
|
7
9
|
end
|
8
10
|
|
9
|
-
def listener_attrs_raw(channel, key, reveal_hide: false)
|
11
|
+
def listener_attrs_raw(channel, key, reveal_hide: false, endpoint: nil, trigger: nil)
|
10
12
|
data_attrs = "data-listener=true data-channel=#{channel} data-key=#{key}"
|
11
13
|
data_attrs += " data-reveal-hide=true" if reveal_hide
|
14
|
+
data_attrs += " data-endpoint=#{endpoint}" if endpoint
|
15
|
+
data_attrs += " data-trigger-on-message=true" if trigger
|
12
16
|
data_attrs
|
13
17
|
end
|
14
18
|
|
15
|
-
def listener_hash(resource, key, reveal_hide: false)
|
19
|
+
def listener_hash(resource, key, reveal_hide: false, endpoint: nil, trigger: nil)
|
16
20
|
hash = {listener: true, channel: resource.class.name + resource.id.to_s, key: key}
|
17
21
|
hash[:reveal_hide] = true if reveal_hide
|
22
|
+
hash[:endpoint] = endpoint if endpoint
|
23
|
+
hash[:trigger] = true if trigger
|
18
24
|
hash
|
19
25
|
end
|
20
26
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreign_office
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Draut
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-04-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|