Procházet zdrojové kódy

move random stuff out of Toolbar

master
isymchych před 10 roky
rodič
revize
7cc682d5a4

+ 1
- 41
app.js Zobrazit soubor

@@ -355,7 +355,7 @@ function initConference(localTracks, connection) {
355 355
     );
356 356
 
357 357
     APP.UI.addListener(UIEvents.USER_INVITED, function (roomUrl) {
358
-        inviteParticipants(
358
+        APP.UI.inviteParticipants(
359 359
             roomUrl,
360 360
             APP.conference.roomName,
361 361
             roomLocker.password,
@@ -479,44 +479,4 @@ $(window).bind('beforeunload', function () {
479 479
     }
480 480
 });
481 481
 
482
-/**
483
- * Invite participants to conference.
484
- */
485
-function inviteParticipants(roomUrl, conferenceName, key, nick) {
486
-    let keyText = "";
487
-    if (key) {
488
-        keyText = APP.translation.translateString(
489
-            "email.sharedKey", {sharedKey: key}
490
-        );
491
-    }
492
-
493
-    let and = APP.translation.translateString("email.and");
494
-    let supportedBrowsers = `Chromium, Google Chrome ${and} Opera`;
495
-
496
-    let subject = APP.translation.translateString(
497
-        "email.subject", {appName:interfaceConfig.APP_NAME, conferenceName}
498
-    );
499
-
500
-    let body = APP.translation.translateString(
501
-        "email.body", {
502
-            appName:interfaceConfig.APP_NAME,
503
-            sharedKeyText: keyText,
504
-            roomUrl,
505
-            supportedBrowsers
506
-        }
507
-    );
508
-
509
-    body = body.replace(/\n/g, "%0D%0A");
510
-
511
-    if (nick) {
512
-        body += "%0D%0A%0D%0A" + nick;
513
-    }
514
-
515
-    if (interfaceConfig.INVITATION_POWERED_BY) {
516
-        body += "%0D%0A%0D%0A--%0D%0Apowered by jitsi.org";
517
-    }
518
-
519
-    window.open(`mailto:?subject=${subject}&body=${body}`, '_blank');
520
-}
521
-
522 482
 export default APP;

+ 81
- 8
modules/UI/UI.js Zobrazit soubor

@@ -95,6 +95,30 @@ function setupToolbars() {
95 95
     BottomToolbar.init(eventEmitter);
96 96
 }
97 97
 
98
+/**
99
+ * Toggles the application in and out of full screen mode
100
+ * (a.k.a. presentation mode in Chrome).
101
+ */
102
+function toggleFullScreen () {
103
+    let fsElement = document.documentElement;
104
+
105
+    if (!document.mozFullScreen && !document.webkitIsFullScreen) {
106
+        //Enter Full Screen
107
+        if (fsElement.mozRequestFullScreen) {
108
+            fsElement.mozRequestFullScreen();
109
+        } else {
110
+            fsElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
111
+        }
112
+    } else {
113
+        //Exit Full Screen
114
+        if (document.mozCancelFullScreen) {
115
+            document.mozCancelFullScreen();
116
+        } else {
117
+            document.webkitCancelFullScreen();
118
+        }
119
+    }
120
+}
121
+
98 122
 UI.notifyGracefulShudown = function () {
99 123
     messageHandler.openMessageDialog(
100 124
         'dialog.serviceUnavailable',
@@ -179,6 +203,18 @@ function registerListeners() {
179 203
     UI.addListener(UIEvents.ETHERPAD_CLICKED, function () {
180 204
         Etherpad.toggleEtherpad(0);
181 205
     });
206
+
207
+    UI.addListener(UIEvents.FULLSCREEN_TOGGLE, toggleFullScreen);
208
+
209
+    UI.addListener(UIEvents.AUTH_CLICKED, function () {
210
+        Authentication.authenticate();
211
+    });
212
+
213
+    UI.addListener(UIEvents.TOGGLE_CHAT, UI.toggleChat);
214
+
215
+    UI.addListener(UIEvents.TOGGLE_SETTINGS, function () {
216
+        PanelToggler.toggleSettingsMenu();
217
+    });
182 218
 }
183 219
 
184 220
 function bindEvents() {
@@ -396,11 +432,7 @@ UI.updateUserRole = function (user) {
396 432
 };
397 433
 
398 434
 UI.notifyAuthRequired = function (intervalCallback) {
399
-    Authentication.openAuthenticationDialog(
400
-        APP.conference.roomName, intervalCallback, function () {
401
-            Toolbar.authenticateClicked();
402
-        }
403
-    );
435
+    Authentication.openAuthenticationDialog(APP.conference.roomName, intervalCallback);
404 436
 };
405 437
 
406 438
 
@@ -413,15 +445,15 @@ UI.getSettings = function () {
413 445
 };
414 446
 
415 447
 UI.toggleFilmStrip = function () {
416
-    return BottomToolbar.toggleFilmStrip();
448
+    BottomToolbar.toggleFilmStrip();
417 449
 };
418 450
 
419 451
 UI.toggleChat = function () {
420
-    return BottomToolbar.toggleChat();
452
+    BottomToolbar.toggleChat();
421 453
 };
422 454
 
423 455
 UI.toggleContactList = function () {
424
-    return BottomToolbar.toggleContactList();
456
+    BottomToolbar.toggleContactList();
425 457
 };
426 458
 
427 459
 UI.inputDisplayNameHandler = function (value) {
@@ -617,4 +649,45 @@ UI.updateDTMFSupport = function (isDTMFSupported) {
617 649
     //Toolbar.showDialPadButton(dtmfSupport);
618 650
 };
619 651
 
652
+/**
653
+ * Invite participants to conference.
654
+ */
655
+UI.inviteParticipants = function (roomUrl, conferenceName, key, nick) {
656
+    let keyText = "";
657
+    if (key) {
658
+        keyText = APP.translation.translateString(
659
+            "email.sharedKey", {sharedKey: key}
660
+        );
661
+    }
662
+
663
+    let and = APP.translation.translateString("email.and");
664
+    let supportedBrowsers = `Chromium, Google Chrome ${and} Opera`;
665
+
666
+    let subject = APP.translation.translateString(
667
+        "email.subject", {appName:interfaceConfig.APP_NAME, conferenceName}
668
+    );
669
+
670
+    let body = APP.translation.translateString(
671
+        "email.body", {
672
+            appName:interfaceConfig.APP_NAME,
673
+            sharedKeyText: keyText,
674
+            roomUrl,
675
+            supportedBrowsers
676
+        }
677
+    );
678
+
679
+    body = body.replace(/\n/g, "%0D%0A");
680
+
681
+    if (nick) {
682
+        body += "%0D%0A%0D%0A" + nick;
683
+    }
684
+
685
+    if (interfaceConfig.INVITATION_POWERED_BY) {
686
+        body += "%0D%0A%0D%0A--%0D%0Apowered by jitsi.org";
687
+    }
688
+
689
+    window.open(`mailto:?subject=${subject}&body=${body}`, '_blank');
690
+};
691
+
692
+
620 693
 module.exports = UI;

+ 43
- 11
modules/UI/authentication/Authentication.js Zobrazit soubor

@@ -1,4 +1,7 @@
1 1
 /* global $, APP*/
2
+/* jshint -W101 */
3
+
4
+import messageHandler from '../util/MessageHandler';
2 5
 
3 6
 var LoginDialog = require('./LoginDialog');
4 7
 var Moderator = require('../../xmpp/moderator');
@@ -10,7 +13,37 @@ var authRetryId = null;
10 13
 var authenticationWindow = null;
11 14
 
12 15
 var Authentication = {
13
-    openAuthenticationDialog: function (roomName, intervalCallback, callback) {
16
+    authenticate () {
17
+        Authentication.focusAuthenticationWindow();
18
+        if (!APP.xmpp.isExternalAuthEnabled()) {
19
+            Authentication.xmppAuthenticate();
20
+            return;
21
+        }
22
+        // Get authentication URL
23
+        if (!APP.xmpp.isMUCJoined()) {
24
+            APP.xmpp.getLoginUrl(APP.conference.roomName, function (url) {
25
+                // If conference has not been started yet - redirect to login page
26
+                window.location.href = url;
27
+            });
28
+        } else {
29
+            APP.xmpp.getPopupLoginUrl(APP.conference.roomName, function (url) {
30
+                // Otherwise - open popup with authentication URL
31
+                var authenticationWindow = Authentication.createAuthenticationWindow(
32
+                    function () {
33
+                        // On popup closed - retry room allocation
34
+                        APP.xmpp.allocateConferenceFocus(
35
+                            APP.conference.roomName,
36
+                            function () { console.info("AUTH DONE"); }
37
+                        );
38
+                    }, url);
39
+                if (!authenticationWindow) {
40
+                    messageHandler.openMessageDialog(null, "dialog.popupError");
41
+                }
42
+            });
43
+        }
44
+    },
45
+
46
+    openAuthenticationDialog (roomName, intervalCallback) {
14 47
         // This is the loop that will wait for the room to be created by
15 48
         // someone else. 'auth_required.moderator' will bring us back here.
16 49
         authRetryId = window.setTimeout(intervalCallback, 5000);
@@ -32,7 +65,7 @@ var Authentication = {
32 65
         var buttons = [];
33 66
         buttons.push({title: buttonTxt, value: "authNow"});
34 67
 
35
-        authDialog = APP.UI.messageHandler.openDialog(
68
+        authDialog = messageHandler.openDialog(
36 69
             title,
37 70
             msg,
38 71
             true,
@@ -44,19 +77,18 @@ var Authentication = {
44 77
 
45 78
                 // Open login popup
46 79
                 if (submitValue === 'authNow') {
47
-                    callback();
80
+                    Authentication.authenticate();
48 81
                 }
49 82
             }
50 83
         );
51 84
     },
52
-    closeAuthenticationWindow: function () {
85
+    closeAuthenticationWindow () {
53 86
         if (authenticationWindow) {
54 87
             authenticationWindow.close();
55 88
             authenticationWindow = null;
56 89
         }
57 90
     },
58
-    xmppAuthenticate: function () {
59
-
91
+    xmppAuthenticate () {
60 92
         var loginDialog = LoginDialog.show(
61 93
             function (connection, state) {
62 94
                 if (!state) {
@@ -86,22 +118,22 @@ var Authentication = {
86 118
                 }
87 119
             }, true);
88 120
     },
89
-    focusAuthenticationWindow: function () {
121
+    focusAuthenticationWindow () {
90 122
         // If auth window exists just bring it to the front
91 123
         if (authenticationWindow) {
92 124
             authenticationWindow.focus();
93 125
             return;
94 126
         }
95 127
     },
96
-    closeAuthenticationDialog: function () {
128
+    closeAuthenticationDialog () {
97 129
         // Close authentication dialog if opened
98 130
         if (authDialog) {
99 131
             authDialog.close();
100 132
             authDialog = null;
101 133
         }
102 134
     },
103
-    createAuthenticationWindow: function (callback, url) {
104
-        authenticationWindow = APP.UI.messageHandler.openCenteredPopup(
135
+    createAuthenticationWindow (callback, url) {
136
+        authenticationWindow = messageHandler.openCenteredPopup(
105 137
             url, 910, 660,
106 138
             // On closed
107 139
             function () {
@@ -112,7 +144,7 @@ var Authentication = {
112 144
             });
113 145
         return authenticationWindow;
114 146
     },
115
-    stopInterval: function () {
147
+    stopInterval () {
116 148
         // Clear retry interval, so that we don't call 'doJoinAfterFocus' twice
117 149
         if (authRetryId) {
118 150
             window.clearTimeout(authRetryId);

+ 105
- 164
modules/UI/toolbars/Toolbar.js Zobrazit soubor

@@ -1,9 +1,6 @@
1 1
 /* global APP, $, config, interfaceConfig */
2 2
 /* jshint -W101 */
3 3
 var messageHandler = require("../util/MessageHandler");
4
-var BottomToolbar = require("./BottomToolbar");
5
-var PanelToggler = require("../side_pannels/SidePanelToggler");
6
-var Authentication = require("../authentication/Authentication");
7 4
 var UIUtil = require("../util/UIUtil");
8 5
 var AnalyticsAdapter = require("../../statistics/AnalyticsAdapter");
9 6
 var Feedback = require("../Feedback");
@@ -13,7 +10,86 @@ var roomUrl = null;
13 10
 var recordingToaster = null;
14 11
 var emitter = null;
15 12
 
16
-var buttonHandlers = {
13
+
14
+/**
15
+ * Opens the invite link dialog.
16
+ */
17
+function openLinkDialog () {
18
+    var inviteAttributes;
19
+
20
+    if (roomUrl === null) {
21
+        inviteAttributes = 'data-i18n="[value]roomUrlDefaultMsg" value="' +
22
+            APP.translation.translateString("roomUrlDefaultMsg") + '"';
23
+    } else {
24
+        inviteAttributes = "value=\"" + encodeURI(roomUrl) + "\"";
25
+    }
26
+    messageHandler.openTwoButtonDialog(
27
+        "dialog.shareLink", null, null,
28
+        `<input id="inviteLinkRef" type="text" ${inviteAttributes} onclick="this.select();" readonly>`,
29
+        false, "dialog.Invite",
30
+        function (e, v) {
31
+            if (v && roomUrl) {
32
+                emitter.emit(UIEvents.USER_INVITED, roomUrl);
33
+            }
34
+        },
35
+        function (event) {
36
+            if (roomUrl) {
37
+                document.getElementById('inviteLinkRef').select();
38
+            } else {
39
+                if (event && event.target) {
40
+                    $(event.target).find('button[value=true]').prop('disabled', true);
41
+                }
42
+            }
43
+        }
44
+    );
45
+}
46
+
47
+// Sets the state of the recording button
48
+function setRecordingButtonState (recordingState) {
49
+    let selector = $('#toolbar_button_record');
50
+
51
+    if (recordingState === 'on') {
52
+        selector.removeClass("icon-recEnable");
53
+        selector.addClass("icon-recEnable active");
54
+
55
+        $("#largeVideo").toggleClass("videoMessageFilter", true);
56
+        let recordOnKey = "recording.on";
57
+        $('#videoConnectionMessage').attr("data-i18n", recordOnKey);
58
+        $('#videoConnectionMessage').text(APP.translation.translateString(recordOnKey));
59
+
60
+        setTimeout(function(){
61
+            $("#largeVideo").toggleClass("videoMessageFilter", false);
62
+            $('#videoConnectionMessage').css({display: "none"});
63
+        }, 1500);
64
+
65
+        recordingToaster = messageHandler.notify(
66
+            null, "recording.toaster", null,
67
+            null, null,
68
+            {timeOut: 0, closeButton: null, tapToDismiss: false}
69
+        );
70
+    } else if (recordingState === 'off') {
71
+        selector.removeClass("icon-recEnable active");
72
+        selector.addClass("icon-recEnable");
73
+
74
+        $("#largeVideo").toggleClass("videoMessageFilter", false);
75
+        $('#videoConnectionMessage').css({display: "none"});
76
+
77
+        if (recordingToaster) {
78
+            messageHandler.remove(recordingToaster);
79
+        }
80
+    } else if (recordingState === 'pending') {
81
+        selector.removeClass("icon-recEnable active");
82
+        selector.addClass("icon-recEnable");
83
+
84
+        $("#largeVideo").toggleClass("videoMessageFilter", true);
85
+        let recordPendingKey = "recording.pending";
86
+        $('#videoConnectionMessage').attr("data-i18n", recordPendingKey);
87
+        $('#videoConnectionMessage').text(APP.translation.translateString(recordPendingKey));
88
+        $('#videoConnectionMessage').css({display: "block"});
89
+    }
90
+}
91
+
92
+const buttonHandlers = {
17 93
     "toolbar_button_mute": function () {
18 94
         if (APP.conference.audioMuted) {
19 95
             AnalyticsAdapter.sendEvent('toolbar.audio.unmuted');
@@ -34,18 +110,18 @@ var buttonHandlers = {
34 110
     },
35 111
     "toolbar_button_record": function () {
36 112
         AnalyticsAdapter.sendEvent('toolbar.recording.toggled');
37
-        return toggleRecording();
113
+        toggleRecording();
38 114
     },
39 115
     "toolbar_button_security": function () {
40 116
         emitter.emit(UIEvents.ROOM_LOCK_CLICKED);
41 117
     },
42 118
     "toolbar_button_link": function () {
43 119
         AnalyticsAdapter.sendEvent('toolbar.invite.clicked');
44
-        return Toolbar.openLinkDialog();
120
+        openLinkDialog();
45 121
     },
46 122
     "toolbar_button_chat": function () {
47 123
         AnalyticsAdapter.sendEvent('toolbar.chat.toggled');
48
-        return BottomToolbar.toggleChat();
124
+        emitter.emit(UIEvents.TOGGLE_CHAT);
49 125
     },
50 126
     "toolbar_button_prezi": function () {
51 127
         AnalyticsAdapter.sendEvent('toolbar.prezi.clicked');
@@ -61,32 +137,32 @@ var buttonHandlers = {
61 137
         } else {
62 138
             AnalyticsAdapter.sendEvent('toolbar.screen.enabled');
63 139
         }
64
-        return APP.desktopsharing.toggleScreenSharing();
140
+        APP.desktopsharing.toggleScreenSharing();
65 141
     },
66 142
     "toolbar_button_fullScreen": function() {
67 143
         AnalyticsAdapter.sendEvent('toolbar.fullscreen.enabled');
68 144
         UIUtil.buttonClick("#toolbar_button_fullScreen", "icon-full-screen icon-exit-full-screen");
69
-        return Toolbar.toggleFullScreen();
145
+        emitter.emit(UIEvents.FULLSCREEN_TOGGLE);
70 146
     },
71 147
     "toolbar_button_sip": function () {
72 148
         AnalyticsAdapter.sendEvent('toolbar.sip.clicked');
73
-        return callSipButtonClicked();
149
+        callSipButtonClicked();
74 150
     },
75 151
     "toolbar_button_dialpad": function () {
76 152
         AnalyticsAdapter.sendEvent('toolbar.sip.dialpad.clicked');
77
-        return dialpadButtonClicked();
153
+        dialpadButtonClicked();
78 154
     },
79 155
     "toolbar_button_settings": function () {
80 156
         AnalyticsAdapter.sendEvent('toolbar.settings.toggled');
81
-        PanelToggler.toggleSettingsMenu();
157
+        emitter.emit(UIEvents.TOGGLE_SETTINGS);
82 158
     },
83 159
     "toolbar_button_hangup": function () {
84 160
         AnalyticsAdapter.sendEvent('toolbar.hangup');
85
-        return hangup();
161
+        hangup();
86 162
     },
87 163
     "toolbar_button_login": function () {
88 164
         AnalyticsAdapter.sendEvent('toolbar.authenticate.login.clicked');
89
-        Toolbar.authenticateClicked();
165
+        emitter.emit(UIEvents.AUTH_CLICKED);
90 166
     },
91 167
     "toolbar_button_logout": function () {
92 168
         AnalyticsAdapter.sendEvent('toolbar.authenticate.logout.clicked');
@@ -140,8 +216,7 @@ function hangup() {
140 216
         }
141 217
     };
142 218
 
143
-    if (Feedback.isEnabled())
144
-    {
219
+    if (Feedback.isEnabled()) {
145 220
         // If the user has already entered feedback, we'll show the window and
146 221
         // immidiately start the conference dispose timeout.
147 222
         if (Feedback.feedbackScore > 0) {
@@ -158,7 +233,7 @@ function hangup() {
158 233
 
159 234
         // If the feedback functionality isn't enabled we show a thank you
160 235
         // dialog.
161
-        APP.UI.messageHandler.openMessageDialog(null, null, null,
236
+        messageHandler.openMessageDialog(null, null, null,
162 237
             APP.translation.translateString("dialog.thankYou",
163 238
                 {appName:interfaceConfig.APP_NAME}));
164 239
     }
@@ -177,7 +252,7 @@ function toggleRecording(predefinedToken) {
177 252
         var msg = APP.translation.generateTranslationHTML(
178 253
             "dialog.recordingToken");
179 254
         var token = APP.translation.translateString("dialog.token");
180
-        APP.UI.messageHandler.openTwoButtonDialog(null, null, null,
255
+        messageHandler.openTwoButtonDialog(null, null, null,
181 256
                 '<h2>' + msg + '</h2>' +
182 257
                 '<input name="recordingToken" type="text" ' +
183 258
                 ' data-i18n="[placeholder]dialog.token" ' +
@@ -197,7 +272,7 @@ function toggleRecording(predefinedToken) {
197 272
             function () { },
198 273
             ':input:first'
199 274
         );
200
-    }, Toolbar.setRecordingButtonState);
275
+    }, setRecordingButtonState);
201 276
 }
202 277
 
203 278
 function dialpadButtonClicked() {
@@ -205,17 +280,16 @@ function dialpadButtonClicked() {
205 280
 }
206 281
 
207 282
 function callSipButtonClicked() {
208
-    var defaultNumber
209
-        = config.defaultSipNumber ? config.defaultSipNumber : '';
210
-
211
-    var sipMsg = APP.translation.generateTranslationHTML(
212
-        "dialog.sipMsg");
213
-    messageHandler.openTwoButtonDialog(null, null, null,
214
-        '<h2>' + sipMsg + '</h2>' +
215
-        '<input name="sipNumber" type="text"' +
216
-        ' value="' + defaultNumber + '" autofocus>',
217
-        false,
218
-        "dialog.Dial",
283
+    let defaultNumber = config.defaultSipNumber
284
+        ? config.defaultSipNumber
285
+        : '';
286
+
287
+    let sipMsg = APP.translation.generateTranslationHTML("dialog.sipMsg");
288
+    messageHandler.openTwoButtonDialog(
289
+        null, null, null,
290
+        `<h2>${sipMsg}</h2>
291
+         <input name="sipNumber" type="text" value="${defaultNumber}" autofocus>`,
292
+        false, "dialog.Dial",
219 293
         function (e, v, m, f) {
220 294
             if (v) {
221 295
                 var numberInput = f.sipNumber;
@@ -228,7 +302,7 @@ function callSipButtonClicked() {
228 302
     );
229 303
 }
230 304
 
231
-var Toolbar = {
305
+const Toolbar = {
232 306
     init (eventEmitter) {
233 307
         emitter = eventEmitter;
234 308
         UIUtil.hideDisabledButtons(defaultToolbarButtons);
@@ -237,37 +311,6 @@ var Toolbar = {
237 311
             $("#" + k).click(buttonHandlers[k]);
238 312
     },
239 313
 
240
-    authenticateClicked () {
241
-        Authentication.focusAuthenticationWindow();
242
-        if (!APP.xmpp.isExternalAuthEnabled()) {
243
-            Authentication.xmppAuthenticate();
244
-            return;
245
-        }
246
-        // Get authentication URL
247
-        if (!APP.xmpp.isMUCJoined()) {
248
-            APP.xmpp.getLoginUrl(APP.conference.roomName, function (url) {
249
-                // If conference has not been started yet - redirect to login page
250
-                window.location.href = url;
251
-            });
252
-        } else {
253
-            APP.xmpp.getPopupLoginUrl(APP.conference.roomName, function (url) {
254
-                // Otherwise - open popup with authentication URL
255
-                var authenticationWindow = Authentication.createAuthenticationWindow(
256
-                    function () {
257
-                        // On popup closed - retry room allocation
258
-                        APP.xmpp.allocateConferenceFocus(
259
-                            APP.conference.roomName,
260
-                            function () { console.info("AUTH DONE"); }
261
-                        );
262
-                    }, url);
263
-                if (!authenticationWindow) {
264
-                    messageHandler.openMessageDialog(
265
-                        null, "dialog.popupError");
266
-                }
267
-            });
268
-        }
269
-    },
270
-
271 314
     /**
272 315
      * Updates the room invite url.
273 316
      */
@@ -293,66 +336,6 @@ var Toolbar = {
293 336
         }
294 337
     },
295 338
 
296
-    /**
297
-     * Opens the invite link dialog.
298
-     */
299
-    openLinkDialog () {
300
-        var inviteAttributes;
301
-
302
-        if (roomUrl === null) {
303
-            inviteAttributes = 'data-i18n="[value]roomUrlDefaultMsg" value="' +
304
-            APP.translation.translateString("roomUrlDefaultMsg") + '"';
305
-        } else {
306
-            inviteAttributes = "value=\"" + encodeURI(roomUrl) + "\"";
307
-        }
308
-        messageHandler.openTwoButtonDialog("dialog.shareLink",
309
-            null, null,
310
-            '<input id="inviteLinkRef" type="text" ' +
311
-                inviteAttributes + ' onclick="this.select();" readonly>',
312
-            false,
313
-            "dialog.Invite",
314
-            function (e, v) {
315
-                if (v && roomUrl) {
316
-                    emitter.emit(UIEvents.USER_INVITED, roomUrl);
317
-                }
318
-            },
319
-            function (event) {
320
-                if (roomUrl) {
321
-                    document.getElementById('inviteLinkRef').select();
322
-                } else {
323
-                    if (event && event.target)
324
-                        $(event.target)
325
-                            .find('button[value=true]').prop('disabled', true);
326
-                }
327
-            }
328
-        );
329
-    },
330
-
331
-    /**
332
-     * Toggles the application in and out of full screen mode
333
-     * (a.k.a. presentation mode in Chrome).
334
-     */
335
-    toggleFullScreen () {
336
-        var fsElement = document.documentElement;
337
-
338
-        if (!document.mozFullScreen && !document.webkitIsFullScreen) {
339
-            //Enter Full Screen
340
-            if (fsElement.mozRequestFullScreen) {
341
-                fsElement.mozRequestFullScreen();
342
-            }
343
-            else {
344
-                fsElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
345
-            }
346
-        } else {
347
-            //Exit Full Screen
348
-            if (document.mozCancelFullScreen) {
349
-                document.mozCancelFullScreen();
350
-            } else {
351
-                document.webkitCancelFullScreen();
352
-            }
353
-        }
354
-    },
355
-
356 339
     /**
357 340
      * Unlocks the lock button state.
358 341
      */
@@ -392,48 +375,6 @@ var Toolbar = {
392 375
         }
393 376
     },
394 377
 
395
-    // Sets the state of the recording button
396
-    setRecordingButtonState (recordingState) {
397
-        var selector = $('#toolbar_button_record');
398
-
399
-        if (recordingState === 'on') {
400
-            selector.removeClass("icon-recEnable");
401
-            selector.addClass("icon-recEnable active");
402
-
403
-            $("#largeVideo").toggleClass("videoMessageFilter", true);
404
-            var recordOnKey = "recording.on";
405
-            $('#videoConnectionMessage').attr("data-i18n", recordOnKey);
406
-            $('#videoConnectionMessage').text(APP.translation.translateString(recordOnKey));
407
-
408
-            setTimeout(function(){
409
-                $("#largeVideo").toggleClass("videoMessageFilter", false);
410
-                $('#videoConnectionMessage').css({display: "none"});
411
-            }, 1500);
412
-
413
-            recordingToaster = messageHandler.notify(null, "recording.toaster", null,
414
-                null, null, {timeOut: 0, closeButton: null, tapToDismiss: false});
415
-        } else if (recordingState === 'off') {
416
-            selector.removeClass("icon-recEnable active");
417
-            selector.addClass("icon-recEnable");
418
-
419
-            $("#largeVideo").toggleClass("videoMessageFilter", false);
420
-            $('#videoConnectionMessage').css({display: "none"});
421
-
422
-            if (recordingToaster)
423
-                messageHandler.remove(recordingToaster);
424
-
425
-        } else if (recordingState === 'pending') {
426
-            selector.removeClass("icon-recEnable active");
427
-            selector.addClass("icon-recEnable");
428
-
429
-            $("#largeVideo").toggleClass("videoMessageFilter", true);
430
-            var recordPendingKey = "recording.pending";
431
-            $('#videoConnectionMessage').attr("data-i18n", recordPendingKey);
432
-            $('#videoConnectionMessage').text(APP.translation.translateString(recordPendingKey));
433
-            $('#videoConnectionMessage').css({display: "block"});
434
-        }
435
-    },
436
-
437 378
     // checks whether recording is enabled and whether we have params
438 379
     // to start automatically recording
439 380
     checkAutoRecord () {

+ 5
- 2
service/UI/UIEvents.js Zobrazit soubor

@@ -1,4 +1,4 @@
1
-var UIEvents = {
1
+export default {
2 2
     NICKNAME_CHANGED: "UI.nickname_changed",
3 3
     SELECTED_ENDPOINT: "UI.selected_endpoint",
4 4
     PINNED_ENDPOINT: "UI.pinned_endpoint",
@@ -25,10 +25,13 @@ var UIEvents = {
25 25
     ETHERPAD_CLICKED: "UI.etherpad_clicked",
26 26
     ROOM_LOCK_CLICKED: "UI.room_lock_clicked",
27 27
     USER_INVITED: "UI.user_invited",
28
+    FULLSCREEN_TOGGLE: "UI.fullscreen_toggle",
29
+    AUTH_CLICKED: "UI.auth_clicked",
30
+    TOGGLE_CHAT: "UI.toggle_chat",
31
+    TOGGLE_SETTINGS: "UI.toggle_settings",
28 32
     /**
29 33
      * Notifies interested parties when the film strip (remote video's panel)
30 34
      * is hidden (toggled) or shown (un-toggled).
31 35
      */
32 36
     FILM_STRIP_TOGGLED: "UI.filmstrip_toggled"
33 37
 };
34
-module.exports = UIEvents;

Načítá se…
Zrušit
Uložit