瀏覽代碼

Updates openMessageDialog to get only key and options.

j8
damencho 8 年之前
父節點
當前提交
563ea1244c
共有 3 個檔案被更改,包括 13 行新增21 行删除
  1. 2
    3
      conference.js
  2. 4
    7
      modules/UI/UI.js
  3. 7
    11
      modules/UI/util/MessageHandler.js

+ 2
- 3
conference.js 查看文件

194
     }
194
     }
195
 
195
 
196
     if (showThankYou) {
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
     if (!config.enableWelcomePage) {
201
     if (!config.enableWelcomePage) {

+ 4
- 7
modules/UI/UI.js 查看文件

1051
  * @returns {Promise} Resolved with value - false if the dialog is enabled and
1051
  * @returns {Promise} Resolved with value - false if the dialog is enabled and
1052
  * resolved with true if the dialog is disabled or the feedback was already
1052
  * resolved with true if the dialog is disabled or the feedback was already
1053
  * submitted. Rejected if another dialog is already displayed. This values are
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
  * conference.maybeRedirectToWelcomePage method.
1055
  * conference.maybeRedirectToWelcomePage method.
1056
  */
1056
  */
1057
 UI.requestFeedbackOnHangup = function () {
1057
 UI.requestFeedbackOnHangup = function () {
1207
 UI.showExtensionRequiredDialog = function (url) {
1207
 UI.showExtensionRequiredDialog = function (url) {
1208
     messageHandler.openMessageDialog(
1208
     messageHandler.openMessageDialog(
1209
         "dialog.extensionRequired",
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
     messageHandler.openTwoButtonDialog({
1231
     messageHandler.openTwoButtonDialog({
1233
         titleKey: 'dialog.externalInstallationTitle',
1232
         titleKey: 'dialog.externalInstallationTitle',
1234
         msgKey: 'dialog.externalInstallationMsg',
1233
         msgKey: 'dialog.externalInstallationMsg',
1235
-        msgString: '',
1236
         leftButtonKey: 'dialog.goToStore',
1234
         leftButtonKey: 'dialog.goToStore',
1237
         submitFunction,
1235
         submitFunction,
1238
         loadedFunction: $.noop,
1236
         loadedFunction: $.noop,
1379
     messageHandler.openMessageDialog(
1377
     messageHandler.openMessageDialog(
1380
         "dialog.error",
1378
         "dialog.error",
1381
         stream.isAudioTrack()? "dialog.micNotSendingData" :
1379
         stream.isAudioTrack()? "dialog.micNotSendingData" :
1382
-            "dialog.cameraNotSendingData",
1383
-        null);
1380
+            "dialog.cameraNotSendingData");
1384
 };
1381
 };
1385
 
1382
 
1386
 UI.updateDevicesAvailability = function (id, devices) {
1383
 UI.updateDevicesAvailability = function (id, devices) {

+ 7
- 11
modules/UI/util/MessageHandler.js 查看文件

29
      *
29
      *
30
      * @param titleKey the key used to find the translation of the title of the
30
      * @param titleKey the key used to find the translation of the title of the
31
      * message, if a message title is not provided.
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
      * @param closeFunction function to be called after
34
      * @param closeFunction function to be called after
37
      * the prompt is closed (optional)
35
      * the prompt is closed (optional)
38
      * @return the prompt that was created, or null
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
         if (!popupEnabled)
40
         if (!popupEnabled)
42
             return null;
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
             title: this._getFormattedTitleString(titleKey),
45
             title: this._getFormattedTitleString(titleKey),
50
             persistent: false,
46
             persistent: false,
51
             promptspeed: 0,
47
             promptspeed: 0,
55
                     closeFunction(e, v, m, f);
51
                     closeFunction(e, v, m, f);
56
             }
52
             }
57
         });
53
         });
58
-        APP.translation.translateElement(dialog);
54
+        APP.translation.translateElement(dialog, i18nOptions);
59
         return dialog;
55
         return dialog;
60
     },
56
     },
61
     /**
57
     /**

Loading…
取消
儲存