Browse Source

Updates openMessageDialog to get only key and options.

j8
damencho 8 years ago
parent
commit
563ea1244c
3 changed files with 13 additions and 21 deletions
  1. 2
    3
      conference.js
  2. 4
    7
      modules/UI/UI.js
  3. 7
    11
      modules/UI/util/MessageHandler.js

+ 2
- 3
conference.js View File

@@ -194,9 +194,8 @@ function maybeRedirectToWelcomePage(showThankYou) {
194 194
     }
195 195
 
196 196
     if (showThankYou) {
197
-        APP.UI.messageHandler.openMessageDialog(null, null,
198
-            APP.translation.generateTranslationHTML(
199
-                "dialog.thankYou", {appName:interfaceConfig.APP_NAME}));
197
+        APP.UI.messageHandler.openMessageDialog(
198
+            null, "dialog.thankYou", {appName:interfaceConfig.APP_NAME});
200 199
     }
201 200
 
202 201
     if (!config.enableWelcomePage) {

+ 4
- 7
modules/UI/UI.js View File

@@ -1051,7 +1051,7 @@ UI.updateDTMFSupport = function (isDTMFSupported) {
1051 1051
  * @returns {Promise} Resolved with value - false if the dialog is enabled and
1052 1052
  * resolved with true if the dialog is disabled or the feedback was already
1053 1053
  * submitted. Rejected if another dialog is already displayed. This values are
1054
- * used to display or not display the thank you dialog from 
1054
+ * used to display or not display the thank you dialog from
1055 1055
  * conference.maybeRedirectToWelcomePage method.
1056 1056
  */
1057 1057
 UI.requestFeedbackOnHangup = function () {
@@ -1207,9 +1207,8 @@ UI.getLargeVideo = function () {
1207 1207
 UI.showExtensionRequiredDialog = function (url) {
1208 1208
     messageHandler.openMessageDialog(
1209 1209
         "dialog.extensionRequired",
1210
-        null,
1211
-        APP.translation.generateTranslationHTML(
1212
-            "dialog.firefoxExtensionPrompt", {url: url}));
1210
+        "dialog.firefoxExtensionPrompt",
1211
+        {url: url});
1213 1212
 };
1214 1213
 
1215 1214
 /**
@@ -1232,7 +1231,6 @@ UI.showExtensionExternalInstallationDialog = function (url) {
1232 1231
     messageHandler.openTwoButtonDialog({
1233 1232
         titleKey: 'dialog.externalInstallationTitle',
1234 1233
         msgKey: 'dialog.externalInstallationMsg',
1235
-        msgString: '',
1236 1234
         leftButtonKey: 'dialog.goToStore',
1237 1235
         submitFunction,
1238 1236
         loadedFunction: $.noop,
@@ -1379,8 +1377,7 @@ UI.showTrackNotWorkingDialog = function (stream) {
1379 1377
     messageHandler.openMessageDialog(
1380 1378
         "dialog.error",
1381 1379
         stream.isAudioTrack()? "dialog.micNotSendingData" :
1382
-            "dialog.cameraNotSendingData",
1383
-        null);
1380
+            "dialog.cameraNotSendingData");
1384 1381
 };
1385 1382
 
1386 1383
 UI.updateDevicesAvailability = function (id, devices) {

+ 7
- 11
modules/UI/util/MessageHandler.js View File

@@ -29,23 +29,19 @@ var messageHandler = {
29 29
      *
30 30
      * @param titleKey the key used to find the translation of the title of the
31 31
      * message, if a message title is not provided.
32
-     * @param messageKey the key used to find the translation of the message,
33
-     * if a message is not provided.
34
-     * @param message the message to show. If a falsy value is provided,
35
-     * messageKey will be used to get a message via the translation API.
32
+     * @param messageKey the key used to find the translation of the message
33
+     * @param i18nOptions the i18n options (optional)
36 34
      * @param closeFunction function to be called after
37 35
      * the prompt is closed (optional)
38 36
      * @return the prompt that was created, or null
39 37
      */
40
-    openMessageDialog: function(titleKey, messageKey, message, closeFunction) {
38
+    openMessageDialog:
39
+        function(titleKey, messageKey, i18nOptions, closeFunction) {
41 40
         if (!popupEnabled)
42 41
             return null;
43 42
 
44
-        if (!message) {
45
-            message = APP.translation.generateTranslationHTML(messageKey);
46
-        }
47
-
48
-        let dialog = $.prompt(message, {
43
+        let dialog = $.prompt(
44
+            APP.translation.generateTranslationHTML(messageKey, i18nOptions), {
49 45
             title: this._getFormattedTitleString(titleKey),
50 46
             persistent: false,
51 47
             promptspeed: 0,
@@ -55,7 +51,7 @@ var messageHandler = {
55 51
                     closeFunction(e, v, m, f);
56 52
             }
57 53
         });
58
-        APP.translation.translateElement(dialog);
54
+        APP.translation.translateElement(dialog, i18nOptions);
59 55
         return dialog;
60 56
     },
61 57
     /**

Loading…
Cancel
Save