foreign_office 0.15.11 → 0.15.12

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: 7f8762a300288dfafad5cd1c5ce761d831f31e20
4
- data.tar.gz: 0bf98d391c89d944c27e04c960114df8f10af5a2
3
+ metadata.gz: 325ba8a4518dc69892add11cc324fa8572ea799a
4
+ data.tar.gz: 4a22aa76e8461d2bf2d318c29614da1db1f271a1
5
5
  SHA512:
6
- metadata.gz: 751dca65d0d5b78cd39efcdbb18617905e31d18be32e685b0b4d2bf8bd5669fc46068efbcff1cc34ff62cc3d291d32f689d68a90a536c6f5b854152268eb3527
7
- data.tar.gz: 8f2f1dc2b2d5a871792ef6146c0764c004b81da88f1854388dbf0c3a38bd0dc9ef20adedfdef3ecd4a4e0c1c1db6277e279a9b259536bc7cb39c21ad184dc9ab
6
+ metadata.gz: 909917d0c42580d95388e0caa10659c09100742833435f2ed569a4fadc97f3457b98058984be25da118397608f46cc0cfc4311406f260415046832d52d73bb0b
7
+ data.tar.gz: f0b30d0f5750b1f348bc977b611e8de527c5dbc5cc5625df5df8594553b846f172fb2d19ad160c37ff1aa2684f00663777a559ed9ae9e6ca53bca913470ac945
@@ -142,38 +142,44 @@ var ForeignOfficeListener = Class.extend({
142
142
  this.delete_key = $listener.data('delete-key');
143
143
  this.href_target = $listener.data('href-target');
144
144
  this.create_modal = $listener.data('create-modal');
145
+ this.mask_me = $listener.data('mask-me');
145
146
  this.channel = $listener.data('channel');
146
147
  if(this.$listener.data('progress-indicator')){
147
148
  this.progress_indicator = new thin_man.AjaxProgress(this.$listener);
148
149
  }
149
150
  },
151
+ maskMe: function(){
152
+ if(this.mask_me)
153
+ this.mask = new thin_man.AjaxMask(this.$listener,'')
154
+ },
155
+ unMaskMe: function(){
156
+ if(this.mask){
157
+ this.mask.remove()
158
+ delete this.mask
159
+ }
160
+ },
150
161
  handleMessage: function(m){
151
162
  var $listener = this.$listener;
163
+ var listener = this
152
164
  if(!m.object.hasOwnProperty(this.object_key) && !m.object.hasOwnProperty(this.delete_key)){
153
165
  return true
154
166
  }
155
167
  if(this.endpoint){
156
- var $progress_target = null
157
- if($listener.data('progress-target')){
158
- $progress_target = $($listener.data('progress-target'))
159
- } else {
160
- $progress_target = []
161
- }
162
168
  if (m.object[this.object_key] == true) {
163
- var progress_indicator = new thin_man.AjaxProgress($progress_target,$listener,'black')
169
+ listener.maskMe()
164
170
  $.get(this.endpoint, function(data){
165
171
  $listener.html(data);
166
172
  }).always(function(){
167
- progress_indicator.stop()
173
+ listener.unMaskMe()
168
174
  })
169
175
  }else if(m.object[this.object_key] == false) {
170
176
  $listener.empty();
171
177
  }else if(typeof(m.object[this.object_key]) == 'string'){
172
- var progress_indicator = new thin_man.AjaxProgress($progress_target,$listener,'black')
178
+ listener.maskMe()
173
179
  $.get(m.object[this.object_key], function(data){
174
180
  $listener.html(data);
175
181
  }).always(function(){
176
- progress_indicator.stop()
182
+ listener.unMaskMe()
177
183
  })
178
184
  }
179
185
  if (m.object[this.delete_key] == true) {
@@ -1,6 +1,6 @@
1
1
  module ForeignOffice
2
2
  module ForeignOfficeHelper
3
- def listener_attrs(resource, key, reveal_hide: false, endpoint: nil, download: nil, trigger: nil, delete: nil, href_target: nil, create_modal: nil, progress_target: nil)
3
+ def listener_attrs(resource, key, reveal_hide: false, endpoint: nil, download: nil, trigger: nil, delete: nil, href_target: nil, create_modal: nil, mask_me: nil)
4
4
  data_attrs = "data-listener=true data-channel=#{resource.class.name}#{resource.id}"
5
5
  if delete
6
6
  data_attrs += " data-delete-key=#{key}"
@@ -12,7 +12,7 @@ module ForeignOffice
12
12
  data_attrs += " data-trigger-on-message=true" if trigger
13
13
  data_attrs += " data-download=true" if download
14
14
  data_attrs += " data-href-target=true" if href_target
15
- data_attrs += " data-progress-target=#{progress_target}" if progress_target
15
+ data_attrs += " data-mask-me=#{mask_me}" if mask_me
16
16
  data_attrs += " data-create-modal=#{create_modal}" if create_modal
17
17
  data_attrs
18
18
  end
@@ -22,7 +22,7 @@ module ForeignOffice
22
22
  data_attrs += " data-key=#{key}"
23
23
  end
24
24
 
25
- def listener_attrs_raw(channel, key, reveal_hide: false, endpoint: nil, download: nil, trigger: nil, delete: nil, href_target: nil, create_modal: nil, progress_target: nil)
25
+ def listener_attrs_raw(channel, key, reveal_hide: false, endpoint: nil, download: nil, trigger: nil, delete: nil, href_target: nil, create_modal: nil, mask_me: nil)
26
26
  data_attrs = "data-listener=true data-channel=#{channel}"
27
27
  if delete
28
28
  data_attrs += " data-delete-key=#{key}"
@@ -34,12 +34,12 @@ module ForeignOffice
34
34
  data_attrs += " data-download=true" if download
35
35
  data_attrs += " data-trigger-on-message=true" if trigger
36
36
  data_attrs += " data-href-target=true" if href_target
37
- data_attrs += " data-progress-target=#{progress_target}" if progress_target
37
+ data_attrs += " data-mask-me=#{mask_me}" if mask_me
38
38
  data_attrs += " data-create-modal=#{create_modal}" if create_modal
39
39
  data_attrs
40
40
  end
41
41
 
42
- def listener_hash(resource, key, reveal_hide: false, endpoint: nil, download: nil, trigger: nil, delete: nil, href_target: nil, create_modal: nil, progress_target: nil)
42
+ def listener_hash(resource, key, reveal_hide: false, endpoint: nil, download: nil, trigger: nil, delete: nil, href_target: nil, create_modal: nil, mask_me: nil)
43
43
  hash = {listener: true, channel: resource.class.name + resource.id.to_s}
44
44
  if delete
45
45
  hash[:delete_key] = key
@@ -52,11 +52,11 @@ module ForeignOffice
52
52
  hash[:trigger_on_message] = true if trigger
53
53
  hash[:href_target] = true if href_target
54
54
  hash[:create_modal] = create_modal if create_modal
55
- hash[:progress_target] = progress_target if progress_target
55
+ hash[:mask_me] = mask_me if mask_me
56
56
  hash
57
57
  end
58
58
 
59
- def listener_hash_raw(channel, key, reveal_hide: false, endpoint: nil, download: nil, trigger: nil, delete: nil, href_target: nil, create_modal: nil, progress_target: nil)
59
+ def listener_hash_raw(channel, key, reveal_hide: false, endpoint: nil, download: nil, trigger: nil, delete: nil, href_target: nil, create_modal: nil, mask_me: nil)
60
60
  hash = {listener: true, channel: channel}
61
61
  if delete
62
62
  hash[:delete_key] = key
@@ -69,7 +69,7 @@ module ForeignOffice
69
69
  hash[:trigger_on_message] = true if trigger
70
70
  hash[:href_target] = true if href_target
71
71
  hash[:create_modal] = create_modal if create_modal
72
- hash[:progress_target] = progress_target if progress_target
72
+ hash[:mask_me] = mask_me if mask_me
73
73
  hash
74
74
  end
75
75
  end
@@ -1,3 +1,3 @@
1
1
  module ForeignOffice
2
- VERSION = "0.15.11"
2
+ VERSION = "0.15.12"
3
3
  end
File without changes
@@ -0,0 +1,33 @@
1
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
2
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is another test"}}
3
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
4
+ ForeignOffice.publish: {:channel=>"TestMeAgain", :object=>{:this=>"is another test"}}
5
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
6
+ ForeignOffice.publish: {:channel=>"TestMeAgain", :object=>{:this=>"is another test"}}
7
+ ForeignOffice#publish! attempt: 1 message: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
8
+ ForeignOffice#publish! attempt: 1 message: {:channel=>"TestMeAgain", :object=>{:this=>"is another test"}}
9
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
10
+ ForeignOffice#publish! attempt: 1 message: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
11
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
12
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
13
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
14
+ ForeignOffice.publish: {:channel=>"TestMeAgain", :object=>{:this=>"is another test"}}
15
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
16
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is another test"}}
17
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
18
+ ForeignOffice.publish: {:channel=>"TestMeAgain", :object=>{:this=>"is another test"}}
19
+ ForeignOffice#publish! attempt: 1 message: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
20
+ ForeignOffice#publish! attempt: 1 message: {:channel=>"TestMeAgain", :object=>{:this=>"is another test"}}
21
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
22
+ ForeignOffice#publish! attempt: 1 message: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
23
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
24
+ ForeignOffice#publish! attempt: 1 message: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
25
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
26
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
27
+ ForeignOffice.publish: {:channel=>"TestMeAgain", :object=>{:this=>"is another test"}}
28
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
29
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is another test"}}
30
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
31
+ ForeignOffice.publish: {:channel=>"TestMeAgain", :object=>{:this=>"is another test"}}
32
+ ForeignOffice#publish! attempt: 1 message: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
33
+ ForeignOffice#publish! attempt: 1 message: {:channel=>"TestMeAgain", :object=>{:this=>"is another test"}}
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.15.11
4
+ version: 0.15.12
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: 2018-01-09 00:00:00.000000000 Z
12
+ date: 2018-03-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -129,6 +129,8 @@ files:
129
129
  - test/dummy/config/locales/en.yml
130
130
  - test/dummy/config/routes.rb
131
131
  - test/dummy/config/secrets.yml
132
+ - test/dummy/db/test.sqlite3
133
+ - test/dummy/log/test.log
132
134
  - test/dummy/public/404.html
133
135
  - test/dummy/public/422.html
134
136
  - test/dummy/public/500.html
@@ -155,45 +157,47 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
157
  version: '0'
156
158
  requirements: []
157
159
  rubyforge_project:
158
- rubygems_version: 2.6.13
160
+ rubygems_version: 2.6.12
159
161
  signing_key:
160
162
  specification_version: 4
161
163
  summary: A light framework that provides functionality for listeners on web clients
162
164
  and publishers on ruby servers. Keep your business logic on the server whenever
163
165
  you can!
164
166
  test_files:
167
+ - test/dummy/app/controllers/application_controller.rb
168
+ - test/dummy/app/views/layouts/application.html.erb
165
169
  - test/dummy/app/assets/javascripts/application.js
166
170
  - test/dummy/app/assets/stylesheets/application.css
167
- - test/dummy/app/controllers/application_controller.rb
168
171
  - test/dummy/app/helpers/application_helper.rb
169
- - test/dummy/app/views/layouts/application.html.erb
172
+ - test/dummy/bin/rake
170
173
  - test/dummy/bin/bundle
171
174
  - test/dummy/bin/rails
172
- - test/dummy/bin/rake
173
- - test/dummy/config/application.rb
174
- - test/dummy/config/boot.rb
175
- - test/dummy/config/database.yml
176
- - test/dummy/config/environment.rb
177
- - test/dummy/config/environments/development.rb
175
+ - test/dummy/config/secrets.yml
176
+ - test/dummy/config/routes.rb
177
+ - test/dummy/config/locales/en.yml
178
178
  - test/dummy/config/environments/production.rb
179
+ - test/dummy/config/environments/development.rb
179
180
  - test/dummy/config/environments/test.rb
180
- - test/dummy/config/initializers/assets.rb
181
+ - test/dummy/config/environment.rb
182
+ - test/dummy/config/application.rb
183
+ - test/dummy/config/database.yml
184
+ - test/dummy/config/boot.rb
181
185
  - test/dummy/config/initializers/backtrace_silencers.rb
182
- - test/dummy/config/initializers/cookies_serializer.rb
183
- - test/dummy/config/initializers/filter_parameter_logging.rb
184
- - test/dummy/config/initializers/inflections.rb
185
186
  - test/dummy/config/initializers/mime_types.rb
187
+ - test/dummy/config/initializers/filter_parameter_logging.rb
186
188
  - test/dummy/config/initializers/session_store.rb
187
189
  - test/dummy/config/initializers/wrap_parameters.rb
188
- - test/dummy/config/locales/en.yml
189
- - test/dummy/config/routes.rb
190
- - test/dummy/config/secrets.yml
190
+ - test/dummy/config/initializers/assets.rb
191
+ - test/dummy/config/initializers/cookies_serializer.rb
192
+ - test/dummy/config/initializers/inflections.rb
191
193
  - test/dummy/config.ru
192
- - test/dummy/public/404.html
194
+ - test/dummy/Rakefile
195
+ - test/dummy/public/favicon.ico
193
196
  - test/dummy/public/422.html
194
197
  - test/dummy/public/500.html
195
- - test/dummy/public/favicon.ico
196
- - test/dummy/Rakefile
198
+ - test/dummy/public/404.html
199
+ - test/dummy/db/test.sqlite3
200
+ - test/dummy/log/test.log
197
201
  - test/dummy/README.rdoc
198
- - test/foreign_office_test.rb
199
202
  - test/test_helper.rb
203
+ - test/foreign_office_test.rb