Browse Source

Merge pull request #489 from isymchych/handle-focus-left

handle FOCUS_LEFT conference error
master
Paweł Domas 9 years ago
parent
commit
ff4de4cb5b
4 changed files with 41 additions and 6 deletions
  1. 5
    1
      conference.js
  2. 1
    0
      lang/main.json
  3. 28
    5
      modules/UI/UI.js
  4. 7
    0
      modules/util/helpers.js

+ 5
- 1
conference.js View File

146
             break;
146
             break;
147
 
147
 
148
         case ConferenceErrors.GRACEFUL_SHUTDOWN:
148
         case ConferenceErrors.GRACEFUL_SHUTDOWN:
149
-            APP.UI.notifyGracefulShudown();
149
+            APP.UI.notifyGracefulShutdown();
150
             break;
150
             break;
151
 
151
 
152
         case ConferenceErrors.JINGLE_FATAL_ERROR:
152
         case ConferenceErrors.JINGLE_FATAL_ERROR:
168
             }
168
             }
169
             break;
169
             break;
170
 
170
 
171
+        case ConferenceErrors.FOCUS_LEFT:
172
+            APP.UI.notifyFocusLeft();
173
+            break;
174
+
171
         default:
175
         default:
172
             this._handleConferenceFailed(err, ...params);
176
             this._handleConferenceFailed(err, ...params);
173
         }
177
         }

+ 1
- 0
lang/main.json View File

143
         "failtoinstall": "Failed to install desktop sharing extension",
143
         "failtoinstall": "Failed to install desktop sharing extension",
144
         "failedpermissions": "Failed to obtain permissions to use the local microphone and/or camera.",
144
         "failedpermissions": "Failed to obtain permissions to use the local microphone and/or camera.",
145
         "bridgeUnavailable": "Jitsi Videobridge is currently unavailable. Please try again later!",
145
         "bridgeUnavailable": "Jitsi Videobridge is currently unavailable. Please try again later!",
146
+        "jicofoUnavailable": "Jicofo is currently unavailable. Please try again later!",
146
         "lockTitle": "Lock failed",
147
         "lockTitle": "Lock failed",
147
         "lockMessage": "Failed to lock the conference.",
148
         "lockMessage": "Failed to lock the conference.",
148
         "warning": "Warning",
149
         "warning": "Warning",

+ 28
- 5
modules/UI/UI.js View File

18
 import VideoLayout from "./videolayout/VideoLayout";
18
 import VideoLayout from "./videolayout/VideoLayout";
19
 import SettingsMenu from "./side_pannels/settings/SettingsMenu";
19
 import SettingsMenu from "./side_pannels/settings/SettingsMenu";
20
 import Settings from "./../settings/Settings";
20
 import Settings from "./../settings/Settings";
21
+import { reload } from '../util/helpers';
21
 
22
 
22
 var EventEmitter = require("events");
23
 var EventEmitter = require("events");
23
 UI.messageHandler = require("./util/MessageHandler");
24
 UI.messageHandler = require("./util/MessageHandler");
136
 /**
137
 /**
137
  * Notify user that server has shut down.
138
  * Notify user that server has shut down.
138
  */
139
  */
139
-UI.notifyGracefulShudown = function () {
140
+UI.notifyGracefulShutdown = function () {
140
     messageHandler.openMessageDialog(
141
     messageHandler.openMessageDialog(
141
         'dialog.serviceUnavailable',
142
         'dialog.serviceUnavailable',
142
         'dialog.gracefulShutdown'
143
         'dialog.gracefulShutdown'
635
         '<input name="password" ' +
636
         '<input name="password" ' +
636
         'type="password" data-i18n="[placeholder]dialog.userPassword"' +
637
         'type="password" data-i18n="[placeholder]dialog.userPassword"' +
637
         ' placeholder="user password">';
638
         ' placeholder="user password">';
638
-    UI.messageHandler.openTwoButtonDialog(null, null, null, message,
639
+    messageHandler.openTwoButtonDialog(null, null, null, message,
639
         true,
640
         true,
640
         "dialog.Ok",
641
         "dialog.Ok",
641
         function (e, v, m, f) {
642
         function (e, v, m, f) {
965
 };
966
 };
966
 
967
 
967
 UI.notifyInternalError = function () {
968
 UI.notifyInternalError = function () {
968
-    UI.messageHandler.showError("dialog.sorry", "dialog.internalError");
969
+    messageHandler.showError("dialog.sorry", "dialog.internalError");
969
 };
970
 };
970
 
971
 
971
 UI.notifyFocusDisconnected = function (focus, retrySec) {
972
 UI.notifyFocusDisconnected = function (focus, retrySec) {
972
-    UI.messageHandler.notify(
973
+    messageHandler.notify(
973
         null, "notify.focus",
974
         null, "notify.focus",
974
         'disconnected', "notify.focusFail",
975
         'disconnected', "notify.focusFail",
975
         {component: focus, ms: retrySec}
976
         {component: focus, ms: retrySec}
976
     );
977
     );
977
 };
978
 };
978
 
979
 
980
+/**
981
+ * Notify user that focus left the conference so page should be reloaded.
982
+ */
983
+UI.notifyFocusLeft = function () {
984
+    let title = APP.translation.generateTranslationHTML(
985
+        'dialog.serviceUnavailable'
986
+    );
987
+    let msg = APP.translation.generateTranslationHTML(
988
+        'dialog.jicofoUnavailable'
989
+    );
990
+    messageHandler.openDialog(
991
+        title,
992
+        msg,
993
+        true, // persistent
994
+        [{title: 'retry'}],
995
+        function () {
996
+            reload();
997
+            return false;
998
+        }
999
+    );
1000
+};
1001
+
979
 /**
1002
 /**
980
  * Updates auth info on the UI.
1003
  * Updates auth info on the UI.
981
  * @param {boolean} isAuthEnabled if authentication is enabled
1004
  * @param {boolean} isAuthEnabled if authentication is enabled
1030
  * Shows dialog with a link to FF extension.
1053
  * Shows dialog with a link to FF extension.
1031
  */
1054
  */
1032
 UI.showExtensionRequiredDialog = function (url) {
1055
 UI.showExtensionRequiredDialog = function (url) {
1033
-    APP.UI.messageHandler.openMessageDialog(
1056
+    messageHandler.openMessageDialog(
1034
         "dialog.extensionRequired",
1057
         "dialog.extensionRequired",
1035
         null,
1058
         null,
1036
         null,
1059
         null,

+ 7
- 0
modules/util/helpers.js View File

12
 
12
 
13
     return deferred;
13
     return deferred;
14
 }
14
 }
15
+
16
+/**
17
+ * Reload page.
18
+ */
19
+export function reload () {
20
+    window.location.reload();
21
+}

Loading…
Cancel
Save