|
@@ -12,8 +12,13 @@ class PageReloadOverlayImpl extends Overlay{
|
12
|
12
|
* Creates new <tt>PageReloadOverlayImpl</tt>
|
13
|
13
|
* @param {number} timeoutSeconds how long the overlay dialog will be
|
14
|
14
|
* displayed, before the conference will be reloaded.
|
|
15
|
+ * @param {boolean} isDisconnect indicates if this reload screen is created
|
|
16
|
+ * to indicate a disconnect
|
|
17
|
+ * @param {boolean} isNetworkFailure <tt>true</tt> indicates that it's
|
|
18
|
+ * caused by network related failure or <tt>false</tt> when it's
|
|
19
|
+ * the infrastructure.
|
15
|
20
|
*/
|
16
|
|
- constructor(timeoutSeconds) {
|
|
21
|
+ constructor(timeoutSeconds, isNetworkFailure) {
|
17
|
22
|
super();
|
18
|
23
|
/**
|
19
|
24
|
* Conference reload counter in seconds.
|
|
@@ -25,6 +30,13 @@ class PageReloadOverlayImpl extends Overlay{
|
25
|
30
|
* @type {number}
|
26
|
31
|
*/
|
27
|
32
|
this.timeout = timeoutSeconds;
|
|
33
|
+
|
|
34
|
+ /**
|
|
35
|
+ * Indicates that a network related failure is the reason for the
|
|
36
|
+ * reload.
|
|
37
|
+ * @type {boolean}
|
|
38
|
+ */
|
|
39
|
+ this.isNetworkFailure = isNetworkFailure;
|
28
|
40
|
}
|
29
|
41
|
/**
|
30
|
42
|
* Constructs overlay body with the warning message and count down towards
|
|
@@ -32,10 +44,27 @@ class PageReloadOverlayImpl extends Overlay{
|
32
|
44
|
* @override
|
33
|
45
|
*/
|
34
|
46
|
_buildOverlayContent() {
|
|
47
|
+ let title = (this.isNetworkFailure)
|
|
48
|
+ ? "dialog.conferenceDisconnectTitle"
|
|
49
|
+ : "dialog.conferenceReloadTitle";
|
|
50
|
+ let message = (this.isNetworkFailure)
|
|
51
|
+ ? "dialog.conferenceDisconnectMsg"
|
|
52
|
+ : "dialog.conferenceReloadMsg";
|
|
53
|
+
|
|
54
|
+ let button = (this.isNetworkFailure)
|
|
55
|
+ ? `<button id="reconnectNow" data-i18n="dialog.reconnectNow"
|
|
56
|
+ class="button-control button-control_primary
|
|
57
|
+ button-control_center"></button>`
|
|
58
|
+ : "";
|
|
59
|
+
|
|
60
|
+ $(document).on('click', '#reconnectNow', () => {
|
|
61
|
+ APP.ConferenceUrl.reload();
|
|
62
|
+ });
|
|
63
|
+
|
35
|
64
|
return `<div class="inlay">
|
36
|
|
- <span data-i18n='dialog.conferenceReloadTitle'
|
|
65
|
+ <span data-i18n=${title}
|
37
|
66
|
class='reload_overlay_title'></span>
|
38
|
|
- <span data-i18n='dialog.conferenceReloadMsg'
|
|
67
|
+ <span data-i18n=${message}
|
39
|
68
|
class='reload_overlay_msg'></span>
|
40
|
69
|
<div>
|
41
|
70
|
<div id='reloadProgressBar'
|
|
@@ -47,6 +76,7 @@ class PageReloadOverlayImpl extends Overlay{
|
47
|
76
|
class='reload_overlay_msg'>
|
48
|
77
|
</span>
|
49
|
78
|
</div>
|
|
79
|
+ ${button}
|
50
|
80
|
</div>`;
|
51
|
81
|
}
|
52
|
82
|
|
|
@@ -122,7 +152,8 @@ export default {
|
122
|
152
|
show(timeoutSeconds, isNetworkFailure, reason) {
|
123
|
153
|
|
124
|
154
|
if (!overlay) {
|
125
|
|
- overlay = new PageReloadOverlayImpl(timeoutSeconds);
|
|
155
|
+ overlay
|
|
156
|
+ = new PageReloadOverlayImpl(timeoutSeconds, isNetworkFailure);
|
126
|
157
|
}
|
127
|
158
|
// Log the page reload event
|
128
|
159
|
if (!this.isVisible()) {
|
|
@@ -132,6 +163,7 @@ export default {
|
132
|
163
|
APP.conference.logEvent(
|
133
|
164
|
'page.reload', undefined /* value */, reason /* label */);
|
134
|
165
|
}
|
135
|
|
- overlay.show();
|
|
166
|
+ // If it's a network failure we enable the light overlay.
|
|
167
|
+ overlay.show(isNetworkFailure);
|
136
|
168
|
}
|
137
|
169
|
};
|