summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--install/ui/add.js2
-rw-r--r--install/ui/details.js1
-rw-r--r--install/ui/dialog.js31
-rw-r--r--install/ui/ipa.js8
-rw-r--r--install/ui/sudo.js1
-rw-r--r--install/ui/widget.js1
6 files changed, 33 insertions, 11 deletions
diff --git a/install/ui/add.js b/install/ui/add.js
index eafcd0d57..4ca0f0418 100644
--- a/install/ui/add.js
+++ b/install/ui/add.js
@@ -27,6 +27,8 @@ IPA.entity_adder_dialog = function(spec) {
spec = spec || {};
+ spec.name = spec.name || 'entity_adder_dialog';
+
var that = IPA.dialog(spec);
that.method = spec.method || 'add';
diff --git a/install/ui/details.js b/install/ui/details.js
index 176e7883e..e652fa3e5 100644
--- a/install/ui/details.js
+++ b/install/ui/details.js
@@ -576,6 +576,7 @@ IPA.details_facet = function(spec, no_init) {
that.show_validation_error = function() {
var dialog = IPA.message_dialog({
+ name: 'validation_error',
title: IPA.messages.dialogs.validation_title,
message: IPA.messages.dialogs.validation_message
});
diff --git a/install/ui/dialog.js b/install/ui/dialog.js
index 2af9ee332..878218419 100644
--- a/install/ui/dialog.js
+++ b/install/ui/dialog.js
@@ -61,7 +61,7 @@ IPA.dialog = function(spec) {
var that = {};
that.entity = IPA.get_entity(spec.entity);
- that.name = spec.name;
+ that.name = spec.name || 'dialog';
that.id = spec.id;
that.title = spec.title;
that.width = spec.width || 500;
@@ -107,6 +107,12 @@ IPA.dialog = function(spec) {
return valid;
};
+ that.get_id = function() {
+ if (that.id) return that.id;
+ if (that.name) return that.name;
+ return null;
+ };
+
/**
* Create content layout
@@ -147,7 +153,11 @@ IPA.dialog = function(spec) {
*/
that.open = function(container) {
- that.container = $('<div/>', { id : that.id });
+ that.container = $('<div/>', {
+ id : that.get_id(),
+ 'data-name': that.name
+ });
+
if (container) {
container.append(that.container);
}
@@ -286,6 +296,8 @@ IPA.adder_dialog = function(spec) {
spec = spec || {};
+ spec.name = spec.name || 'adder_dialog';
+
var that = IPA.dialog(spec);
that.external = spec.external;
@@ -557,6 +569,7 @@ IPA.adder_dialog = function(spec) {
IPA.deleter_dialog = function (spec) {
spec = spec || {};
+ spec.name = spec.name || 'deleter_dialog';
var that = IPA.dialog(spec);
@@ -639,13 +652,13 @@ IPA.deleter_dialog = function (spec) {
IPA.message_dialog = function(spec) {
- var that = IPA.dialog(spec);
+ spec = spec || {};
- var init = function() {
- spec = spec || {};
- that.message = spec.message || '';
- that.on_ok = spec.on_ok;
- };
+ spec.name = spec.name || 'message_dialog';
+
+ var that = IPA.dialog(spec);
+ that.message = spec.message || '';
+ that.on_ok = spec.on_ok;
that.create = function() {
$('<p/>', {
@@ -664,8 +677,6 @@ IPA.message_dialog = function(spec) {
}
});
- init();
-
that.message_dialog_create = that.create;
return that;
diff --git a/install/ui/ipa.js b/install/ui/ipa.js
index 413951ff1..8a690c984 100644
--- a/install/ui/ipa.js
+++ b/install/ui/ipa.js
@@ -331,6 +331,7 @@ IPA.logout = function() {
function show_error(message) {
var dialog = IPA.message_dialog({
+ name: 'logout_error',
message: message,
title: IPA.messages.login.logout_error
});
@@ -1023,6 +1024,7 @@ IPA.concurrent_command = function(spec) {
command = command_info.command;
if(!command) {
var dialog = IPA.message_dialog({
+ name: 'internal_error',
title: IPA.get_message('errors.error', 'Error'),
message: IPA.get_message('errors.internal_error', 'Internal error.')
});
@@ -1118,6 +1120,7 @@ IPA.concurrent_command = function(spec) {
} else {
var dialog = IPA.message_dialog({
+ name: 'operation_error',
title: IPA.get_message('dialogs.batch_error_title', 'Operations Error'),
message: IPA.get_message('dialogs.batch_error_message', 'Some operations failed.')
});
@@ -1377,7 +1380,7 @@ IPA.error_dialog = function(spec) {
var init = function() {
spec = spec || {};
- that.id = 'error_dialog';
+ that.id = spec.id || 'error_dialog';
that.xhr = spec.xhr || {};
that.text_status = spec.text_status || '';
that.error_thrown = spec.error_thrown || {};
@@ -1554,6 +1557,7 @@ IPA.create_4304_error_handler = function(adder_dialog) {
if (data && data.error && data.error.code === 4304) {
dialog = IPA.message_dialog({
+ name: 'error_4304_info',
message: data.error.message,
title: adder_dialog.title,
on_ok: function() {
@@ -1621,6 +1625,8 @@ IPA.unauthorized_dialog = function(spec) {
];
spec.visible_buttons = spec.visible_buttons || ['retry'];
+ spec.name = spec.name || 'unauthorized_dialog';
+ spec.id = spec.id || spec.name;
var that = IPA.error_dialog(spec);
diff --git a/install/ui/sudo.js b/install/ui/sudo.js
index a586c4349..0dcf43228 100644
--- a/install/ui/sudo.js
+++ b/install/ui/sudo.js
@@ -798,6 +798,7 @@ IPA.sudo.options_section = function(spec) {
title = title.replace('${entity}', label);
var dialog = IPA.dialog({
+ name: 'option-adder-dialog',
title: title,
sections: [
{
diff --git a/install/ui/widget.js b/install/ui/widget.js
index 6864d88f5..0889ee0be 100644
--- a/install/ui/widget.js
+++ b/install/ui/widget.js
@@ -3297,6 +3297,7 @@ IPA.sshkey_widget = function(spec) {
that.create_edit_dialog = function() {
var dialog = IPA.dialog({
+ name: 'sshkey-edit-dialog',
title: IPA.messages.objects.sshkeystore.set_dialog_title,
width: 500,
height: 380