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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 94aacbefb0ec0dd37ea0beabc83c8eb2748652f9
4
- data.tar.gz: 58e3af65fef4deae56bb541ed0e493943696ff20
3
+ metadata.gz: e607b876892172ef11ee3dfc659ba5834ce1ec91
4
+ data.tar.gz: 539b25bdc3f9d4cc9460c76cfa93409231e23042
5
5
  SHA512:
6
- metadata.gz: 3193d50c4627c06d7a6cc3f092fe64c3a174ab2063bc6ea6dbfbc38577e8cda921c955695ca9322e14d5a0378ba731e006aa007d4199f96a4d22d5dd95f258fa
7
- data.tar.gz: 1a0228c3702fc502402760843e77b1b2bc98f88665fecd3d3feea9ec211a0733b560b6b077e39ba7db75f61a48bebf61b1862f92e3e8184eca3d5eb644dd5547
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
@@ -1,3 +1,3 @@
1
1
  module ForeignOffice
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  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.6.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-03-06 00:00:00.000000000 Z
12
+ date: 2015-04-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails