|
|
@@ -41,13 +41,12 @@ var messageHandler = {
|
|
41
|
41
|
if (!popupEnabled)
|
|
42
|
42
|
return null;
|
|
43
|
43
|
|
|
44
|
|
- let title = APP.translation.generateTranslationHTML(titleKey);
|
|
45
|
44
|
if (!message) {
|
|
46
|
45
|
message = APP.translation.generateTranslationHTML(messageKey);
|
|
47
|
46
|
}
|
|
48
|
47
|
|
|
49
|
48
|
return $.prompt(message, {
|
|
50
|
|
- title: this._getFormattedTitleString(title),
|
|
|
49
|
+ title: this._getFormattedTitleString(titleKey),
|
|
51
|
50
|
persistent: false,
|
|
52
|
51
|
promptspeed: 0,
|
|
53
|
52
|
classes: this._getDialogClasses(),
|
|
|
@@ -107,7 +106,6 @@ var messageHandler = {
|
|
107
|
106
|
buttons.push({title: cancelButton, value: false});
|
|
108
|
107
|
|
|
109
|
108
|
var message = msgString;
|
|
110
|
|
- var title = APP.translation.generateTranslationHTML(titleKey);
|
|
111
|
109
|
if (msgKey) {
|
|
112
|
110
|
message = APP.translation.generateTranslationHTML(msgKey);
|
|
113
|
111
|
}
|
|
|
@@ -117,7 +115,7 @@ var messageHandler = {
|
|
117
|
115
|
}
|
|
118
|
116
|
|
|
119
|
117
|
twoButtonDialog = $.prompt(message, {
|
|
120
|
|
- title: this._getFormattedTitleString(title),
|
|
|
118
|
+ title: this._getFormattedTitleString(titleKey),
|
|
121
|
119
|
persistent: false,
|
|
122
|
120
|
buttons: buttons,
|
|
123
|
121
|
defaultButton: defaultButton,
|
|
|
@@ -146,7 +144,7 @@ var messageHandler = {
|
|
146
|
144
|
* Shows a message to the user with two buttons: first is given as a
|
|
147
|
145
|
* parameter and the second is Cancel.
|
|
148
|
146
|
*
|
|
149
|
|
- * @param titleString the title of the message
|
|
|
147
|
+ * @param titleKey the key for the title of the message
|
|
150
|
148
|
* @param msgString the text of the message
|
|
151
|
149
|
* @param persistent boolean value which determines whether the message is
|
|
152
|
150
|
* persistent or not
|
|
|
@@ -158,13 +156,13 @@ var messageHandler = {
|
|
158
|
156
|
* loaded
|
|
159
|
157
|
* @param closeFunction function to be called on dialog close
|
|
160
|
158
|
*/
|
|
161
|
|
- openDialog: function (titleString, msgString, persistent, buttons,
|
|
|
159
|
+ openDialog: function (titleKey, msgString, persistent, buttons,
|
|
162
|
160
|
submitFunction, loadedFunction, closeFunction) {
|
|
163
|
161
|
if (!popupEnabled)
|
|
164
|
162
|
return;
|
|
165
|
163
|
|
|
166
|
164
|
let args = {
|
|
167
|
|
- title: this._getFormattedTitleString(titleString),
|
|
|
165
|
+ title: this._getFormattedTitleString(titleKey),
|
|
168
|
166
|
persistent: persistent,
|
|
169
|
167
|
buttons: buttons,
|
|
170
|
168
|
defaultButton: 1,
|
|
|
@@ -187,13 +185,12 @@ var messageHandler = {
|
|
187
|
185
|
*
|
|
188
|
186
|
* @return the title string formatted as a div.
|
|
189
|
187
|
*/
|
|
190
|
|
- _getFormattedTitleString(titleString) {
|
|
|
188
|
+ _getFormattedTitleString(titleKey) {
|
|
191
|
189
|
let $titleString = $('<h2>');
|
|
192
|
190
|
$titleString.addClass('aui-dialog2-header-main');
|
|
193
|
|
- $titleString.append(titleString);
|
|
194
|
|
- titleString = $('<div>').append($titleString).html();
|
|
195
|
|
-
|
|
196
|
|
- return titleString;
|
|
|
191
|
+ $titleString.attr('data-i18n',titleKey);
|
|
|
192
|
+ $titleString.append(APP.translation.translateString(titleKey));
|
|
|
193
|
+ return $('<div>').append($titleString).html();
|
|
197
|
194
|
},
|
|
198
|
195
|
|
|
199
|
196
|
/**
|
|
|
@@ -238,9 +235,9 @@ var messageHandler = {
|
|
238
|
235
|
|
|
239
|
236
|
for (let state in statesObject) {
|
|
240
|
237
|
let currentState = statesObject[state];
|
|
241
|
|
- if(currentState.title) {
|
|
242
|
|
- let title = currentState.title;
|
|
243
|
|
- currentState.title = this._getFormattedTitleString(title);
|
|
|
238
|
+ if(currentState.titleKey) {
|
|
|
239
|
+ currentState.title
|
|
|
240
|
+ = this._getFormattedTitleString(currentState.titleKey);
|
|
244
|
241
|
}
|
|
245
|
242
|
}
|
|
246
|
243
|
return new Impromptu(statesObject, options);
|