From 6350686710c49b632ea7b1085e4db6755056d263 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Mon, 6 Dec 2010 16:30:10 -0600 Subject: [PATCH] Dialog i18n The ipa_add_dialog has been fixed to initialize the fields which will get the labels from metadata. Hard-coded labels have been removed from field declarations. The superior() method has been removed because it doesn't work with multi-level inheritance. Superclass method for now is called using _ (e.g. widget_init). --- install/static/add.js | 3 ++- install/static/details.js | 7 ------- install/static/entity.js | 17 ++--------------- install/static/group.js | 15 ++++++--------- install/static/hbac.js | 6 ++---- install/static/hbacsvc.js | 14 ++++---------- install/static/hbacsvcgroup.js | 8 +++----- install/static/host.js | 5 ++--- install/static/hostgroup.js | 14 ++++++-------- install/static/netgroup.js | 14 ++++++-------- install/static/policy.js | 34 ++++++++++++++-------------------- install/static/service.js | 9 ++++++--- install/static/sudocmd.js | 14 ++++---------- install/static/sudocmdgroup.js | 8 +++----- install/static/sudorule.js | 8 ++------ install/static/user.js | 15 +++++++-------- install/static/widget.js | 20 +++++--------------- 17 files changed, 74 insertions(+), 137 deletions(-) diff --git a/install/static/add.js b/install/static/add.js index d587b80d9..f2eebb8ac 100644 --- a/install/static/add.js +++ b/install/static/add.js @@ -84,6 +84,8 @@ function ipa_add_dialog(spec) { that.add_button('Cancel', function() { that.close(); }); + + that.dialog_init(); }; that.add = function(record, on_success, on_error) { @@ -109,7 +111,6 @@ function ipa_add_dialog(spec) { ipa_cmd('add', args, options, on_success, on_error, that.entity_name); }; - that.superior_init = that.superior('init'); that.add_dialog_init = that.init; return that; diff --git a/install/static/details.js b/install/static/details.js index f0e24ac08..cc1a4e19d 100644 --- a/install/static/details.js +++ b/install/static/details.js @@ -142,13 +142,6 @@ function ipa_details_section(spec){ that.fields = []; that.fields_by_name = {}; - that.superior = function(name) { - var method = that[name]; - return function () { - return method.apply(that, arguments); - }; - }; - that.__defineGetter__("entity_name", function(){ return that._entity_name; }); diff --git a/install/static/entity.js b/install/static/entity.js index dcb7e6f82..9372d917e 100644 --- a/install/static/entity.js +++ b/install/static/entity.js @@ -47,13 +47,6 @@ function ipa_facet(spec) { that.create_action_panel = ipa_facet_create_action_panel; - that.superior = function(name) { - var method = that[name]; - return function () { - return method.apply(that, arguments); - }; - }; - function init() { } @@ -105,13 +98,6 @@ function ipa_entity(spec) { that.associations = []; that.associations_by_name = {}; - that.superior = function(name) { - var method = that[name]; - return function () { - return method.apply(that, arguments); - }; - }; - that.get_dialog = function(name) { return that.dialogs_by_name[name]; }; @@ -273,7 +259,6 @@ function ipa_entity_set_add_definition(entity_name, data) { 'title': data[1] }); entity.add_dialog(dialog); - dialog.init(); for (var i=0; i