소스 검색

Separate disconnect overlay.

j8
yanas 8 년 전
부모
커밋
c9488d5ee9
6개의 변경된 파일71개의 추가작업 그리고 10개의 파일을 삭제
  1. 8
    0
      css/_mixins.scss
  2. 4
    0
      css/components/_button-control.scss
  3. 6
    1
      css/overlay/_overlay.scss
  4. 3
    0
      lang/main.json
  5. 13
    4
      modules/UI/overlay/Overlay.js
  6. 37
    5
      modules/UI/reload_overlay/PageReloadOverlay.js

+ 8
- 0
css/_mixins.scss 파일 보기

@@ -150,4 +150,12 @@
150 150
   overflow: hidden;
151 151
   text-overflow: ellipsis;
152 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 파일 보기

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

+ 6
- 1
css/overlay/_overlay.scss 파일 보기

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

+ 3
- 0
lang/main.json 파일 보기

@@ -215,6 +215,9 @@
215 215
         "failedpermissions": "Failed to obtain permissions to use the local microphone and/or camera.",
216 216
         "conferenceReloadTitle": "Unfortunately, something went wrong",
217 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 221
         "conferenceReloadTimeLeft": "__seconds__ sec.",
219 222
         "maxUsersLimitReached": "The limit for maximum number of participants in the conference has been reached. The conference is full. Please try again later!",
220 223
         "lockTitle": "Lock failed",

+ 13
- 4
modules/UI/overlay/Overlay.js 파일 보기

@@ -28,13 +28,19 @@ export default class Overlay{
28 28
     }
29 29
     /**
30 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 37
         let overlayContent = this._buildOverlayContent();
35 38
 
39
+        let containerClass = isLightOverlay ? "overlay__container-light"
40
+                                            : "overlay__container";
41
+
36 42
         this.$overlay = $(`
37
-            <div class='overlay__container'>
43
+            <div class=${containerClass}>
38 44
                 <div class='overlay__content'>
39 45
                     ${overlayContent}
40 46
                 </div>
@@ -61,10 +67,13 @@ export default class Overlay{
61 67
     /**
62 68
      * Shows the overlay dialog adn attaches the underlying HTML representation
63 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 78
         if (!this.isVisible()) {
70 79
             this.$overlay.appendTo('body');

+ 37
- 5
modules/UI/reload_overlay/PageReloadOverlay.js 파일 보기

@@ -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
 };

Loading…
취소
저장