Browse Source

Adds suspend overlay.

master
damencho 8 years ago
parent
commit
96b280668d
4 changed files with 83 additions and 2 deletions
  1. 5
    1
      css/_inlay.scss
  2. 4
    0
      lang/main.json
  3. 11
    1
      modules/UI/UI.js
  4. 63
    0
      modules/UI/suspended_overlay/SuspendedOverlay.js

+ 5
- 1
css/_inlay.scss View File

7
     text-align: center;
7
     text-align: center;
8
 
8
 
9
     &__title {
9
     &__title {
10
-        margin: 12px 0;
10
+        margin: 17px 0;
11
         padding-bottom: 17px;
11
         padding-bottom: 17px;
12
         color: $popoverFontColor;
12
         color: $popoverFontColor;
13
         font-size: 21px;
13
         font-size: 21px;
26
         margin: 0 10px;
26
         margin: 0 10px;
27
         font-size: 50px;
27
         font-size: 50px;
28
     }
28
     }
29
+
30
+    &__button {
31
+        float: none !important;
32
+    }
29
 }
33
 }

+ 4
- 0
lang/main.json View File

79
         "policyText": " ",
79
         "policyText": " ",
80
         "title": "__app__ needs to use your microphone and camera."
80
         "title": "__app__ needs to use your microphone and camera."
81
     },
81
     },
82
+    "suspendedoverlay": {
83
+        "title": "Your video call was interrupted, because this computer went to sleep.",
84
+        "rejoinKeyTitle": "Rejoin"
85
+    },
82
     "toolbar": {
86
     "toolbar": {
83
         "mute": "Mute / Unmute",
87
         "mute": "Mute / Unmute",
84
         "videomute": "Start / Stop camera",
88
         "videomute": "Start / Stop camera",

+ 11
- 1
modules/UI/UI.js View File

16
     from './gum_overlay/UserMediaPermissionsGuidanceOverlay';
16
     from './gum_overlay/UserMediaPermissionsGuidanceOverlay';
17
 
17
 
18
 import PageReloadOverlay from './reload_overlay/PageReloadOverlay';
18
 import PageReloadOverlay from './reload_overlay/PageReloadOverlay';
19
+import SuspendedOverlay from './suspended_overlay/SuspendedOverlay';
19
 import VideoLayout from "./videolayout/VideoLayout";
20
 import VideoLayout from "./videolayout/VideoLayout";
20
 import FilmStrip from "./videolayout/FilmStrip";
21
 import FilmStrip from "./videolayout/FilmStrip";
21
 import SettingsMenu from "./side_pannels/settings/SettingsMenu";
22
 import SettingsMenu from "./side_pannels/settings/SettingsMenu";
1399
 
1400
 
1400
 /**
1401
 /**
1401
  * Indicates if any the "top" overlays are currently visible. The check includes
1402
  * Indicates if any the "top" overlays are currently visible. The check includes
1402
- * the call overlay, GUM permissions overlay and a page reload overlay.
1403
+ * the call overlay, suspended overlay, GUM permissions overlay
1404
+ * and a page reload overlay.
1403
  *
1405
  *
1404
  * @returns {*|boolean} {true} if the overlay is visible, {false} otherwise
1406
  * @returns {*|boolean} {true} if the overlay is visible, {false} otherwise
1405
  */
1407
  */
1406
 UI.isOverlayVisible = function () {
1408
 UI.isOverlayVisible = function () {
1407
     return RingOverlay.isVisible()
1409
     return RingOverlay.isVisible()
1410
+        || SuspendedOverlay.isVisible()
1408
         || PageReloadOverlay.isVisible()
1411
         || PageReloadOverlay.isVisible()
1409
         || GumPermissionsOverlay.isVisible();
1412
         || GumPermissionsOverlay.isVisible();
1410
 };
1413
 };
1427
     GumPermissionsOverlay.show(browser);
1430
     GumPermissionsOverlay.show(browser);
1428
 };
1431
 };
1429
 
1432
 
1433
+/**
1434
+ * Shows suspended overlay with a button to rejoin conference.
1435
+ */
1436
+UI.showSuspendedOverlay = function () {
1437
+    SuspendedOverlay.show();
1438
+};
1439
+
1430
 /**
1440
 /**
1431
  * Hides browser-specific overlay with guidance how to proceed with gUM prompt.
1441
  * Hides browser-specific overlay with guidance how to proceed with gUM prompt.
1432
  */
1442
  */

+ 63
- 0
modules/UI/suspended_overlay/SuspendedOverlay.js View File

1
+/* global $, APP */
2
+
3
+import Overlay from '../overlay/Overlay';
4
+
5
+/**
6
+ * An overlay dialog which is shown when a suspended event is detected.
7
+ */
8
+class SuspendedOverlayImpl extends Overlay{
9
+    /**
10
+     * Creates new <tt>SuspendedOverlayImpl</tt>
11
+     */
12
+    constructor() {
13
+        super();
14
+
15
+        $(document).on('click', '#rejoin', () => {
16
+            APP.ConferenceUrl.reload();
17
+        });
18
+    }
19
+    /**
20
+     * Constructs overlay body with the message and a button to rejoin.
21
+     * @override
22
+     */
23
+    _buildOverlayContent() {
24
+        return (
25
+        `<div class="inlay">
26
+            <span class="inlay__icon icon-microphone"></span>
27
+            <span class="inlay__icon icon-camera"></span>
28
+            <h3 class="inlay__title" data-i18n="suspendedoverlay.title"></h3>
29
+            <button id="rejoin" 
30
+                 data-i18n="suspendedoverlay.rejoinKeyTitle" 
31
+                 class="inlay__button button-control button-control_primary">
32
+            </button>
33
+        </div>`);
34
+    }
35
+}
36
+
37
+/**
38
+ * Holds the page suspended overlay instance.
39
+ *
40
+ * {@type SuspendedOverlayImpl}
41
+ */
42
+let overlay;
43
+
44
+export default {
45
+    /**
46
+     * Checks whether the page suspended overlay has been displayed.
47
+     * @return {boolean} <tt>true</tt> if the page suspended overlay is
48
+     * currently visible or <tt>false</tt> otherwise.
49
+     */
50
+    isVisible() {
51
+        return overlay && overlay.isVisible();
52
+    },
53
+    /**
54
+     * Shows the page suspended overlay.
55
+     */
56
+    show() {
57
+
58
+        if (!overlay) {
59
+            overlay = new SuspendedOverlayImpl();
60
+        }
61
+        overlay.show();
62
+    }
63
+};

Loading…
Cancel
Save