summaryrefslogtreecommitdiffstats
path: root/install/ui/dialog.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2011-08-05 17:12:21 +0200
committerEndi S. Dewata <edewata@redhat.com>2011-08-05 19:14:19 +0000
commit08905eb9a9039b38c032275a87b4f5602e5a63dd (patch)
treea566ca2e61144a2d5d98b751f56c9af125b367e3 /install/ui/dialog.js
parent966fbd6485f3e2a1bc7fa4c3f96fcb435daa553d (diff)
downloadfreeipa-08905eb9a9039b38c032275a87b4f5602e5a63dd.tar.gz
freeipa-08905eb9a9039b38c032275a87b4f5602e5a63dd.tar.xz
freeipa-08905eb9a9039b38c032275a87b4f5602e5a63dd.zip
Fixed adding host without DNS reverse zone
https://fedorahosted.org/freeipa/ticket/1481 Shows status dialog instead of error dialog (error 4304 is treated like success). Refactored error dialog. Added generic message dialog (IPA.message_dialog) Modified core tests to work with dialog.
Diffstat (limited to 'install/ui/dialog.js')
-rw-r--r--install/ui/dialog.js32
1 files changed, 31 insertions, 1 deletions
diff --git a/install/ui/dialog.js b/install/ui/dialog.js
index 0a1d5428a..0ec84a786 100644
--- a/install/ui/dialog.js
+++ b/install/ui/dialog.js
@@ -32,6 +32,7 @@ IPA.dialog = function(spec) {
that.entity = spec.entity;
that.name = spec.name;
+ that.id = spec.id;
that.title = spec.title;
that.width = spec.width || 400;
that.height = spec.height;
@@ -194,7 +195,7 @@ IPA.dialog = function(spec) {
*/
that.open = function(container) {
- that.container = $('<div/>');
+ that.container = $('<div/>', { id : that.id });
if (container) {
container.append(that.container);
}
@@ -257,6 +258,7 @@ IPA.dialog = function(spec) {
that.dialog_create = that.create;
that.dialog_open = that.open;
+ that.dialog_close = that.close;
var fields = spec.fields || [];
for (var i=0; i<fields.length; i++) {
@@ -656,3 +658,31 @@ IPA.deleter_dialog = function (spec) {
return that;
};
+
+IPA.message_dialog = function(spec) {
+
+ var that = IPA.dialog(spec);
+
+ var init = function() {
+ spec = spec || {};
+ that.message = spec.message || '';
+ that.on_ok = spec.on_ok;
+ };
+
+ that.create = function() {
+ $('<p/>', {
+ 'text': that.message
+ }).appendTo(that.container);
+ };
+
+ that.add_button(IPA.messages.buttons.ok, function() {
+ that.close();
+ if(that.on_ok) {
+ that.on_ok();
+ }
+ });
+
+ init();
+
+ return that;
+};