foreign_office 0.16.4 → 0.16.5
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b08bb9e93823d0150d00b9e4c82691e43372cb8c
|
|
4
|
+
data.tar.gz: 7e0daf42d8e983a4d62d032670bca7679f2d1c4b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9c80c506ecb46cb0b1200d5c06fe0febfabaee082f7f2271f33c2c4187d4bc47befe06cc50a04f57332749bc2488187c6fe7a4280da256bd0b79731cd467fb7f
|
|
7
|
+
data.tar.gz: 54e15cb61e12427c501b9ca5fe6ff27cc1596c7af5ae25414da1daa62d275fc5f9c4133fa2d1e4198cb2702ae14058031861251f30b21523281ed603f00f14c1
|
|
@@ -25,6 +25,7 @@ var ForeignOffice = Class.extend({
|
|
|
25
25
|
}
|
|
26
26
|
debug_logger.log("Connecting to message bus using " + bus_class_name, 1, 'foreign-office')
|
|
27
27
|
this.bus = new bus_class(config);
|
|
28
|
+
this.bus.bind_state_change()
|
|
28
29
|
if(typeof config.disconnect_alert != 'undefined'){
|
|
29
30
|
this.disconnect_alert = config.disconnect_alert
|
|
30
31
|
} else {
|
|
@@ -13,6 +13,24 @@ var PusherBus = Class.extend({
|
|
|
13
13
|
},
|
|
14
14
|
get_channel_name: function(channel_name){
|
|
15
15
|
return channel_name.replace(/::/g, '.')
|
|
16
|
+
},
|
|
17
|
+
bind_state_change: function(){
|
|
18
|
+
this.pusher.connection.bind('state_change', function(states){
|
|
19
|
+
if(states.previous === "connected" && states.current === "connecting"){
|
|
20
|
+
reload_page();
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
this.pusher.connection.bind('disconnected', function(){
|
|
24
|
+
reload_page();
|
|
25
|
+
});
|
|
16
26
|
}
|
|
17
|
-
|
|
27
|
+
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
var reload_page = function(){
|
|
31
|
+
if (
|
|
32
|
+
window.confirm('The pusher connection has been lost. Click ok to refresh the page.')
|
|
33
|
+
) { window.location.reload()}
|
|
34
|
+
};
|
|
35
|
+
|
|
18
36
|
PusherBus.third_party_library = 'Pusher'
|
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.16.
|
|
4
|
+
version: 0.16.5
|
|
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-
|
|
12
|
+
date: 2018-08-20 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|