Преглед на файлове

Ring overlay improvements and enable buttons fix

j8
yanas преди 8 години
родител
ревизия
d250623fde

+ 1
- 1
Makefile Целия файл

@@ -14,7 +14,7 @@ OUTPUT_DIR = .
14 14
 LIBJITSIMEET_DIR = node_modules/lib-jitsi-meet/
15 15
 IFRAME_API_DIR = ./modules/API/external
16 16
 
17
-all: update-deps compile compile-iframe-api uglify uglify-iframe-api deploy clean
17
+all: compile compile-iframe-api uglify uglify-iframe-api deploy clean
18 18
 
19 19
 update-deps:
20 20
 	$(NPM) update

+ 3
- 2
css/_toolbars.scss Целия файл

@@ -1,7 +1,7 @@
1 1
 .toolbar {
2 2
     background-color: rgba(0,0,0,0.5);
3 3
     position: relative;
4
-    z-index: 900;
4
+    z-index: $toolbarZ;
5 5
     height: 100%;
6 6
     pointer-events: auto;
7 7
 }
@@ -13,7 +13,7 @@
13 13
     top:0;
14 14
     left:0;
15 15
     right:0;
16
-    z-index:10;
16
+    z-index: $toolbarZ;
17 17
     pointer-events: none;
18 18
     min-height: 100px;
19 19
     transform: translateY(-100%);
@@ -76,6 +76,7 @@
76 76
 
77 77
 #toolbar_button_hangup {
78 78
     color: #BF2117;
79
+    font-size: $hangupFontSize !important;
79 80
 }
80 81
 
81 82
 #toolbar_button_etherpad {

+ 7
- 2
css/_variables.scss Целия файл

@@ -3,6 +3,7 @@
3 3
  */
4 4
 $baseFontFamily: 'open_sanslight', 'Helvetica Neue', Helvetica, Arial, sans-serif;
5 5
 $toolbarFontSize: 1.9em;
6
+$hangupFontSize: 2em;
6 7
 
7 8
 /**
8 9
  * Size variables.
@@ -16,7 +17,7 @@ $defaultColor: #F1F1F1;
16 17
 $defaultSemiDarkColor: #ACACAC;
17 18
 $defaultDarkColor: #4F4F4F;
18 19
 $defaultBackground: #474747;
19
-$toolbarSelectBackground: rgba(0, 0, 0, 0.6);
20
+$toolbarSelectBackground: rgba(0, 0, 0, .6);
20 21
 $inputBackground: rgba(132, 132, 132, .5);
21 22
 $inputSemiBackground: rgba(132, 132, 132, .8);
22 23
 $inputLightBackground: #EBEBEB;
@@ -28,4 +29,8 @@ $buttonBackground: #44A5FF;
28 29
  */
29 30
 $borderRadius: 4px;
30 31
 
31
-
32
+/**
33
+ * Z-indexes. TODO: Replace this by a function.
34
+ */
35
+$toolbarZ: 900;
36
+$overlayZ: 800;

+ 2
- 1
css/main.scss Целия файл

@@ -21,7 +21,7 @@
21 21
 
22 22
 @import 'toastr';
23 23
 @import 'base';
24
-@import 'overlay';
24
+@import 'overlay/overlay';
25 25
 @import 'videolayout_default';
26 26
 @import 'jquery-impromptu';
27 27
 @import 'modaldialog';
@@ -33,6 +33,7 @@
33 33
 @import 'jitsi_popover';
34 34
 @import 'contact_list';
35 35
 @import 'chat';
36
+@import 'ringing/ringing';
36 37
 @import 'welcome_page';
37 38
 @import 'toolbars';
38 39
 @import 'side_toolbar_container';

css/_overlay.scss → css/overlay/_overlay.scss Целия файл

@@ -1,11 +1,10 @@
1
-
2 1
 .overlay {
3 2
     position: fixed;
4 3
     left: 0;
5 4
     top: 0;
6 5
     width: 100%;
7 6
     height: 100%;
8
-    z-index: 1013;
7
+    z-index: $overlayZ;
9 8
     background: #21B9FC; /* Old browsers */
10 9
     opacity: 0.75;
11 10
     display: block;
@@ -19,7 +18,7 @@
19 18
     width: 100%;
20 19
     height: 100%;
21 20
     position: fixed;
22
-    z-index: 1013;
21
+    z-index: $overlayZ;
23 22
 }
24 23
 
25 24
 .overlay_content {
@@ -36,23 +35,6 @@
36 35
     margin-left: -200px;
37 36
 }
38 37
 
39
-.overlay_avatar {
40
-    width: 200px;
41
-    height: 200px;
42
-    position: relative;
43
-    border-radius: 100px;
44
-    z-index: 1013;
45
-    float: left;
46
-    margin-left: 100px;
47
-}
48
-
49
-.overlay_text {
50
-    position: relative;
51
-    width: 400px;
52
-    z-index: 1013;
53
-    margin-top: 50px;
54
-    float: left;
55
-}
56 38
 
57 39
 .overlay_text_small {
58 40
     font-size: 18px;

+ 1
- 1
index.html Целия файл

@@ -120,7 +120,6 @@
120 120
                     </li>
121 121
                 </ul>
122 122
             </span>
123
-            <a class="button icon-link" id="toolbar_button_link" data-container="body" data-toggle="popover" data-placement="right" data-i18n="[content]toolbar.invite" content="Invite others"></a>
124 123
             <a class="button icon-contactList" id="toolbar_contact_list" data-container="body" data-toggle="popover" data-placement="right" shortcut="contactlistpopover"  data-i18n="[content]bottomtoolbar.contactlist" content="Open / close contact list">
125 124
                 <span id="numberOfParticipants"></span>
126 125
             </a>
@@ -138,6 +137,7 @@
138 137
             <a class="button icon-telephone" id="toolbar_button_sip" data-container="body" data-toggle="popover" data-placement="right" content="Call SIP number" data-i18n="[content]toolbar.sip" style="display: none"></a>
139 138
             <a class="button icon-dialpad" id="toolbar_button_dialpad" data-container="body" data-toggle="popover" data-placement="right" content="Open dialpad" data-i18n="[content]toolbar.dialpad" style="display: none"></a>
140 139
             <a class="button icon-settings" id="toolbar_button_settings" data-container="body" data-toggle="popover" data-placement="right" content="Settings" data-i18n="[content]toolbar.Settings"></a>
140
+            <a class="button icon-full-screen" id="toolbar_button_fullScreen" data-container="body" data-toggle="popover" data-placement="right" shortcut="toggleFullscreenPopover" data-i18n="[content]toolbar.fullscreen" content="Enter / Exit Full Screen"></a>
141 141
             <a class="button icon-toggle-filmstrip" id="toolbar_film_strip" data-container="body" data-toggle="popover" shortcut="filmstripPopover" data-placement="right" data-i18n="[content]toolbar.filmstrip" content="Show / hide videos"></a>
142 142
             <a class="button icon-feedback" id="feedbackButton" data-container="body" data-toggle="popover" data-placement="right" data-i18n="[content]feedback"></a>
143 143
             <div id="sideToolbarContainer">

+ 6
- 3
interface_config.js Целия файл

@@ -2,6 +2,9 @@ var interfaceConfig = {
2 2
     CANVAS_EXTRA: 104,
3 3
     CANVAS_RADIUS: 0,
4 4
     SHADOW_COLOR: '#ffffff',
5
+    // TO FIX: this needs to be handled from SASS variables. There are some
6
+    // methods allowing to use variables both in css and js.
7
+    DEFAULT_BACKGROUND: '#474747',
5 8
     INITIAL_TOOLBAR_TIMEOUT: 20000,
6 9
     TOOLBAR_TIMEOUT: 4000,
7 10
     DEFAULT_REMOTE_DISPLAY_NAME: "Fellow Jitster",
@@ -16,8 +19,8 @@ var interfaceConfig = {
16 19
     INVITATION_POWERED_BY: true,
17 20
     // the toolbar buttons line is intentionally left in one line, to be able
18 21
     // to easily override values or remove them using regex
19
-    MAIN_TOOLBAR_BUTTONS: ['microphone', 'camera', 'desktop', 'fullscreen', 'hangup'], // jshint ignore:line
20
-    TOOLBAR_BUTTONS: ['authentication', 'microphone', 'camera', 'desktop', 'recording', 'security', 'invite', 'chat', 'etherpad', 'sharedvideo', 'fullscreen', 'sip', 'dialpad', 'settings', 'hangup', 'filmstrip', 'contacts'], // jshint ignore:line
22
+    MAIN_TOOLBAR_BUTTONS: ['microphone', 'camera', 'desktop', 'invite', 'hangup'], // jshint ignore:line
23
+    TOOLBAR_BUTTONS: ['profile', 'authentication', 'microphone', 'camera', 'desktop', 'recording', 'security', 'invite', 'chat', 'etherpad', 'sharedvideo', 'fullscreen', 'sip', 'dialpad', 'settings', 'hangup', 'filmstrip', 'contacts'], // jshint ignore:line
21 24
     // Determines how the video would fit the screen. 'both' would fit the whole
22 25
     // screen, 'height' would fit the original video height to the height of the
23 26
     // screen, 'width' would fit the original video width to the width of the
@@ -30,4 +33,4 @@ var interfaceConfig = {
30 33
     RANDOM_AVATAR_URL_PREFIX: false,
31 34
     RANDOM_AVATAR_URL_SUFFIX: false,
32 35
     FILM_STRIP_MAX_HEIGHT: 120
33
-};
36
+};

+ 1
- 1
lang/main.json Целия файл

@@ -11,7 +11,7 @@
11 11
     "raisedHand": "Would like to speak",
12 12
     "defaultNickname": "ex. Jane Pink",
13 13
     "defaultLink": "e.g. __url__",
14
-    "calling": "Calling __name__ ...",
14
+    "callingName": "__name__",
15 15
     "userMedia": {
16 16
       "react-nativeGrantPermissions": "Please grant permissions to use your camera and microphone by pressing <b><i>Allow</i></b> button",
17 17
       "chromeGrantPermissions": "Please grant permissions to use your camera and microphone by pressing <b><i>Allow</i></b> button",

+ 9
- 0
modules/UI/UI.js Целия файл

@@ -1499,6 +1499,15 @@ UI.hideRingOverLay = function () {
1499 1499
     FilmStrip.toggleFilmStrip(true);
1500 1500
 };
1501 1501
 
1502
+/**
1503
+ * Indicates if the ring overlay is currently visible.
1504
+ *
1505
+ * @returns {*|boolean} {true} if the ring overlay is visible, {false} otherwise
1506
+ */
1507
+UI.isRingOverlayVisible = function () {
1508
+    return RingOverlay.isVisible();
1509
+};
1510
+
1502 1511
 /**
1503 1512
  * Shows browser-specific overlay with guidance how to proceed with gUM prompt.
1504 1513
  * @param {string} browser - name of browser for which to show the guidance

+ 50
- 22
modules/UI/ring_overlay/RingOverlay.js Целия файл

@@ -1,4 +1,5 @@
1 1
 /* global $ */
2
+/* jshint -W101 */
2 3
 
3 4
 /**
4 5
  * Shows ring overlay
@@ -8,35 +9,39 @@ class RingOverlay {
8 9
      * @param callee instance of User class from TokenData.js
9 10
      */
10 11
     constructor(callee) {
12
+        this._containerId = 'ringOverlay';
13
+        this._audioContainerId = 'ringOverlayRinging';
14
+
11 15
         this.callee = callee;
12
-        this._buildHtml();
13
-        this.audio = $("#ring_overlay_ringing");
14
-        this.audio[0].play();
16
+        this.render();
17
+        this.audio = document.getElementById(this._audioContainerId);
18
+        this.audio.play();
15 19
         this._setAudioTimeout();
16 20
     }
17 21
 
18 22
     /**
19 23
      * Builds and appends the ring overlay to the html document
20 24
      */
21
-    _buildHtml() {
22
-        $("body").append("<div class='overlay_container' >" +
23
-        "<div class='overlay' /><div class='overlay_content'>" +
24
-        "<img class='overlay_avatar' src='" +
25
-        this.callee.getAvatarUrl() + "' />" +
26
-        "<span data-i18n='calling' data-i18n-options='" +
27
-        JSON.stringify({name: this.callee.getName()}) +
28
-        "' class='overlay_text'>Calling " +
29
-        this.callee.getName() + "...</span></div>" +
30
-        "<audio id='ring_overlay_ringing' src='/sounds/ring.ogg' /></div>");
25
+    _getHtmlStr(callee) {
26
+        return `
27
+            <div id="${this._containerId}" class='ringing' >
28
+                <div class='ringing__content'>
29
+                    <p>Calling...</p>
30
+                    <img class='ringing__avatar' src="${callee.getAvatarUrl()}" />
31
+                    <div class="ringing__caller-info">
32
+                        <p>${callee.getName()}</p>
33
+                    </div>
34
+                </div>
35
+                <audio id="${this._audioContainerId}" src="/sounds/ring.ogg" />
36
+            </div>`;
31 37
     }
32 38
 
33 39
     /**
34
-     * Sets the interval that is going to play the ringing sound.
40
+     *
35 41
      */
36
-    _setAudioTimeout() {
37
-        this.interval = setInterval( () => {
38
-            this.audio[0].play();
39
-        }, 5000);
42
+    render() {
43
+        this.htmlStr = this._getHtmlStr(this.callee);
44
+        this._attach();
40 45
     }
41 46
 
42 47
     /**
@@ -44,9 +49,28 @@ class RingOverlay {
44 49
      * related to the ring overlay.
45 50
      */
46 51
     destroy() {
47
-        if(this.interval)
52
+        if (this.interval) {
48 53
             clearInterval(this.interval);
49
-        $(".overlay_container").remove();
54
+        }
55
+
56
+        this._detach();
57
+    }
58
+
59
+    _attach() {
60
+        $("body").append(this.htmlStr);
61
+    }
62
+
63
+    _detach() {
64
+        $(`#${this._containerId}`).remove();
65
+    }
66
+
67
+    /**
68
+     * Sets the interval that is going to play the ringing sound.
69
+     */
70
+    _setAudioTimeout() {
71
+        this.interval = setInterval( () => {
72
+            this.audio.play();
73
+        }, 5000);
50 74
     }
51 75
 }
52 76
 
@@ -66,26 +90,30 @@ export default {
66 90
         if(overlay) {
67 91
             this.hide();
68 92
         }
93
+
69 94
         overlay = new RingOverlay(callee);
70 95
     },
96
+
71 97
     /**
72 98
      * Hides the ring overlay. Destroys all the elements related to the ring
73 99
      * overlay.
74 100
      */
75 101
     hide() {
76
-        if(!overlay)
102
+        if(!overlay) {
77 103
             return false;
104
+        }
78 105
         overlay.destroy();
79 106
         overlay = null;
80 107
         return true;
81 108
     },
109
+
82 110
     /**
83 111
      * Checks whether or not the ring overlay is currently displayed.
84 112
      *
85 113
      * @returns {boolean} true if the ring overlay is currently displayed or
86 114
      * false otherwise.
87 115
      */
88
-    isDisplayed () {
116
+    isVisible () {
89 117
         return overlay !== null;
90 118
     }
91 119
 };

+ 21
- 9
modules/UI/toolbars/Toolbar.js Целия файл

@@ -214,22 +214,25 @@ const defaultToolbarButtons = {
214 214
     },
215 215
     'desktop': {
216 216
         id: 'toolbar_button_desktopsharing',
217
-        className: "button icon-share-desktop",
217
+        className: 'button icon-share-desktop',
218 218
         shortcut: 'D',
219 219
         shortcutAttr: 'toggleDesktopSharingPopover',
220 220
         shortcutFunc: function() {
221 221
             JitsiMeetJS.analytics.sendEvent('shortcut.screen.toggled');
222 222
             APP.conference.toggleScreenSharing();
223 223
         },
224
-        shortcutDescription: "keyboardShortcuts.toggleScreensharing",
225
-        content: "Share screen",
226
-        i18n: "[content]toolbar.sharescreen"
224
+        shortcutDescription: 'keyboardShortcuts.toggleScreensharing',
225
+        content: 'Share screen',
226
+        i18n: '[content]toolbar.sharescreen'
227 227
     },
228 228
     'security': {
229 229
         id: 'toolbar_button_security'
230 230
     },
231 231
     'invite': {
232
-        id: 'toolbar_button_link'
232
+        id: 'toolbar_button_link',
233
+        className: 'button icon-link',
234
+        content: 'Invite others',
235
+        i18n: '[content]toolbar.invite'
233 236
     },
234 237
     'chat': {
235 238
         id: 'toolbar_button_chat',
@@ -239,16 +242,16 @@ const defaultToolbarButtons = {
239 242
             JitsiMeetJS.analytics.sendEvent('shortcut.chat.toggled');
240 243
             APP.UI.toggleChat();
241 244
         },
242
-        shortcutDescription: "keyboardShortcuts.toggleChat",
243
-        sideContainerId: "chat_container"
245
+        shortcutDescription: 'keyboardShortcuts.toggleChat',
246
+        sideContainerId: 'chat_container'
244 247
     },
245 248
     'contacts': {
246 249
         id: 'toolbar_contact_list',
247
-        sideContainerId: "contacts_container"
250
+        sideContainerId: 'contacts_container'
248 251
     },
249 252
     'profile': {
250 253
         id: 'toolbar_button_profile',
251
-        sideContainerId: "profile_container"
254
+        sideContainerId: 'profile_container'
252 255
     },
253 256
     'etherpad': {
254 257
         id: 'toolbar_button_etherpad'
@@ -695,6 +698,15 @@ const Toolbar = {
695 698
         });
696 699
     },
697 700
 
701
+    /**
702
+     * Adds the given button to the main (top) toolbar.
703
+     *
704
+     * @param {Object} the button to add.
705
+     * @param {boolean} isFirst indicates if this is the first button in the
706
+     * toolbar
707
+     * @param {boolean} isLast indicates if this is the last button in the
708
+     * toolbar
709
+     */
698 710
     _addMainToolbarButton(button, isFirst, isLast) {
699 711
         let buttonElement = document.createElement("a");
700 712
         if (button.className)

+ 1
- 1
modules/UI/toolbars/ToolbarToggler.js Целия файл

@@ -35,7 +35,7 @@ function hideToolbar(force) {
35 35
     clearTimeout(toolbarTimeoutObject);
36 36
     toolbarTimeoutObject = null;
37 37
 
38
-    if (Toolbar.isHovered()) {
38
+    if (Toolbar.isHovered() || APP.UI.isRingOverlayVisible()) {
39 39
         toolbarTimeoutObject = setTimeout(hideToolbar, toolbarTimeout);
40 40
     } else if (!SideContainerToggler.isVisible() || force) {
41 41
         Toolbar.hide();

+ 2
- 1
modules/UI/util/MessageHandler.js Целия файл

@@ -258,7 +258,8 @@ var messageHandler = {
258 258
     notify: function(displayName, displayNameKey, cls, messageKey,
259 259
                      messageArguments, options) {
260 260
 
261
-        if(!notificationsEnabled)
261
+        // If we're in ringing state we skip all toaster notifications.
262
+        if(!notificationsEnabled || APP.UI.isRingOverlayVisible())
262 263
             return;
263 264
 
264 265
         var displayNameSpan = '<span class="nickname" ';

+ 2
- 2
modules/UI/util/UIUtil.js Целия файл

@@ -112,7 +112,7 @@
112 112
         var selector = Object.keys(mappings)
113 113
           .map(function (buttonName) {
114 114
                 return UIUtil.isButtonEnabled(buttonName)
115
-                    ? null : mappings[buttonName].id; })
115
+                    ? null : "#" + mappings[buttonName].id; })
116 116
           .filter(function (item) { return item; })
117 117
           .join(',');
118 118
         $(selector).hide();
@@ -120,7 +120,7 @@
120 120
 
121 121
     redirect (url) {
122 122
          window.location.href = url;
123
-     },
123
+    },
124 124
 
125 125
      isFullScreen () {
126 126
          return document.fullScreen

Loading…
Отказ
Запис