Browse Source

Separate disconnect overlay.

master
yanas 8 years ago
parent
commit
c9488d5ee9

+ 8
- 0
css/_mixins.scss View File

150
   overflow: hidden;
150
   overflow: hidden;
151
   text-overflow: ellipsis;
151
   text-overflow: ellipsis;
152
   white-space: nowrap;
152
   white-space: nowrap;
153
+}
154
+
155
+/**
156
+ * Creates a semi-transparent background with the given color and alpha
157
+ * (opacity) value.
158
+ */
159
+@mixin transparentBg($color, $alpha) {
160
+  background-color: rgba(red($color), green($color), blue($color), $alpha);
153
 }
161
 }

+ 4
- 0
css/components/_button-control.scss View File

82
             color: $linkHoverFontColor;
82
             color: $linkHoverFontColor;
83
         }
83
         }
84
     }
84
     }
85
+
86
+    &_center {
87
+        float: none !important;
88
+    }
85
 }
89
 }

+ 6
- 1
css/overlay/_overlay.scss View File

1
 .overlay {
1
 .overlay {
2
-    &__container {
2
+    &__container,
3
+    &__container-light {
3
         top: 0;
4
         top: 0;
4
         left: 0;
5
         left: 0;
5
         width: 100%;
6
         width: 100%;
9
         background: $defaultBackground;
10
         background: $defaultBackground;
10
     }
11
     }
11
 
12
 
13
+    &__container-light {
14
+        @include transparentBg($defaultBackground, 0.7);
15
+    }
16
+
12
     &__content {
17
     &__content {
13
         position: absolute;
18
         position: absolute;
14
         margin: 0 auto;
19
         margin: 0 auto;

+ 3
- 0
lang/main.json View File

215
         "failedpermissions": "Failed to obtain permissions to use the local microphone and/or camera.",
215
         "failedpermissions": "Failed to obtain permissions to use the local microphone and/or camera.",
216
         "conferenceReloadTitle": "Unfortunately, something went wrong",
216
         "conferenceReloadTitle": "Unfortunately, something went wrong",
217
         "conferenceReloadMsg": "We're trying to fix this",
217
         "conferenceReloadMsg": "We're trying to fix this",
218
+        "conferenceDisconnectTitle": "You have been disconnected. You may want to check your network connection.",
219
+        "conferenceDisconnectMsg": "Reconnecting in...",
220
+        "reconnectNow": "Reconnect now",
218
         "conferenceReloadTimeLeft": "__seconds__ sec.",
221
         "conferenceReloadTimeLeft": "__seconds__ sec.",
219
         "maxUsersLimitReached": "The limit for maximum number of participants in the conference has been reached. The conference is full. Please try again later!",
222
         "maxUsersLimitReached": "The limit for maximum number of participants in the conference has been reached. The conference is full. Please try again later!",
220
         "lockTitle": "Lock failed",
223
         "lockTitle": "Lock failed",

+ 13
- 4
modules/UI/overlay/Overlay.js View File

28
     }
28
     }
29
     /**
29
     /**
30
      * Constructs the HTML body of the overlay dialog.
30
      * Constructs the HTML body of the overlay dialog.
31
+     *
32
+     * @param isLightOverlay indicates that this will be a light overlay look
33
+     * and feel.
31
      */
34
      */
32
-    buildOverlayHtml() {
35
+    buildOverlayHtml(isLightOverlay) {
33
 
36
 
34
         let overlayContent = this._buildOverlayContent();
37
         let overlayContent = this._buildOverlayContent();
35
 
38
 
39
+        let containerClass = isLightOverlay ? "overlay__container-light"
40
+                                            : "overlay__container";
41
+
36
         this.$overlay = $(`
42
         this.$overlay = $(`
37
-            <div class='overlay__container'>
43
+            <div class=${containerClass}>
38
                 <div class='overlay__content'>
44
                 <div class='overlay__content'>
39
                     ${overlayContent}
45
                     ${overlayContent}
40
                 </div>
46
                 </div>
61
     /**
67
     /**
62
      * Shows the overlay dialog adn attaches the underlying HTML representation
68
      * Shows the overlay dialog adn attaches the underlying HTML representation
63
      * to the DOM.
69
      * to the DOM.
70
+     *
71
+     * @param isLightOverlay indicates that this will be a light overlay look
72
+     * and feel.
64
      */
73
      */
65
-    show() {
74
+    show(isLightOverlay) {
66
 
75
 
67
-        !this.$overlay && this.buildOverlayHtml();
76
+        !this.$overlay && this.buildOverlayHtml(isLightOverlay);
68
 
77
 
69
         if (!this.isVisible()) {
78
         if (!this.isVisible()) {
70
             this.$overlay.appendTo('body');
79
             this.$overlay.appendTo('body');

+ 37
- 5
modules/UI/reload_overlay/PageReloadOverlay.js View File

12
      * Creates new <tt>PageReloadOverlayImpl</tt>
12
      * Creates new <tt>PageReloadOverlayImpl</tt>
13
      * @param {number} timeoutSeconds how long the overlay dialog will be
13
      * @param {number} timeoutSeconds how long the overlay dialog will be
14
      * displayed, before the conference will be reloaded.
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
         super();
22
         super();
18
         /**
23
         /**
19
          * Conference reload counter in seconds.
24
          * Conference reload counter in seconds.
25
          * @type {number}
30
          * @type {number}
26
          */
31
          */
27
         this.timeout = timeoutSeconds;
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
      * Constructs overlay body with the warning message and count down towards
42
      * Constructs overlay body with the warning message and count down towards
32
      * @override
44
      * @override
33
      */
45
      */
34
     _buildOverlayContent() {
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
         return `<div class="inlay">
64
         return `<div class="inlay">
36
-                    <span data-i18n='dialog.conferenceReloadTitle'
65
+                    <span data-i18n=${title}
37
                           class='reload_overlay_title'></span>
66
                           class='reload_overlay_title'></span>
38
-                    <span data-i18n='dialog.conferenceReloadMsg'
67
+                    <span data-i18n=${message}
39
                           class='reload_overlay_msg'></span>
68
                           class='reload_overlay_msg'></span>
40
                     <div>
69
                     <div>
41
                         <div id='reloadProgressBar'
70
                         <div id='reloadProgressBar'
47
                             class='reload_overlay_msg'>
76
                             class='reload_overlay_msg'>
48
                         </span>
77
                         </span>
49
                     </div>
78
                     </div>
79
+                    ${button}
50
                 </div>`;
80
                 </div>`;
51
     }
81
     }
52
 
82
 
122
     show(timeoutSeconds, isNetworkFailure, reason) {
152
     show(timeoutSeconds, isNetworkFailure, reason) {
123
 
153
 
124
         if (!overlay) {
154
         if (!overlay) {
125
-            overlay = new PageReloadOverlayImpl(timeoutSeconds);
155
+            overlay
156
+                = new PageReloadOverlayImpl(timeoutSeconds, isNetworkFailure);
126
         }
157
         }
127
         // Log the page reload event
158
         // Log the page reload event
128
         if (!this.isVisible()) {
159
         if (!this.isVisible()) {
132
             APP.conference.logEvent(
163
             APP.conference.logEvent(
133
                 'page.reload', undefined /* value */, reason /* label */);
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
 };

Loading…
Cancel
Save