From b7700ea815222b4de80741ad77b31707051300bd Mon Sep 17 00:00:00 2001 From: Martin Kosek Date: Wed, 16 Feb 2011 14:26:35 +0100 Subject: Remove WebUI identifiers from global namespace Many WebUI identifiers were defined in a global namespace. This is not a good programming practice and may result in name clashes, for example with other libraries. This patch moves these variables to IPA namespace or its sub-namespaces, when meaningful. https://fedorahosted.org/freeipa/ticket/212 --- install/ui/sudorule.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'install/ui/sudorule.js') diff --git a/install/ui/sudorule.js b/install/ui/sudorule.js index b25a9dd3..b9fc7be8 100644 --- a/install/ui/sudorule.js +++ b/install/ui/sudorule.js @@ -22,6 +22,8 @@ /* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */ +IPA.sudo = {}; + IPA.entity_factories.sudorule = function () { var that = IPA.entity({ @@ -35,7 +37,7 @@ IPA.entity_factories.sudorule = function () { 'label': 'Search' }); - var dialog = IPA.sudorule_add_dialog({ + var dialog = IPA.sudo.rule_add_dialog({ 'name': 'add', 'title': 'Add New Rule' }); @@ -55,7 +57,7 @@ IPA.entity_factories.sudorule = function () { }; -IPA.sudorule_add_dialog = function (spec) { +IPA.sudo.rule_add_dialog = function (spec) { spec = spec || {}; @@ -109,7 +111,7 @@ IPA.sudorule_details_facet = function (spec) { }); } else { - section = IPA.sudorule_details_general_section({ + section = IPA.sudo.rule_details_general_section({ 'name': 'general', 'label': 'General' }); @@ -176,13 +178,13 @@ IPA.sudorule_details_facet = function (spec) { 'other_entity': 'hostgroup', 'add_method': 'add_host', 'remove_method': 'remove_host' })); - section = IPA.sudorule_details_command_section({ + section = IPA.sudo.rule_details_command_section({ 'name': 'command', 'label': 'Run Commands' }); that.add_section(section); - section = IPA.sudorule_details_runas_section({ + section = IPA.sudo.rule_details_runas_section({ 'name': 'runas', 'label': 'As Whom' }); @@ -377,7 +379,7 @@ IPA.sudorule_details_facet = function (spec) { }; -IPA.sudorule_details_general_section = function (spec){ +IPA.sudo.rule_details_general_section = function (spec){ spec = spec || {}; @@ -514,7 +516,7 @@ IPA.sudorule_details_general_section = function (spec){ }; -IPA.sudorule_details_command_section = function (spec){ +IPA.sudo.rule_details_command_section = function (spec){ spec = spec || {}; @@ -686,7 +688,7 @@ IPA.sudorule_details_command_section = function (spec){ }; -IPA.sudorule_details_runas_section = function (spec){ +IPA.sudo.rule_details_runas_section = function (spec){ spec = spec || {}; @@ -913,7 +915,7 @@ IPA.sudorule_association_table_widget = function (spec) { template = 'sudorule-'+that.other_entity+'-dialog.html #contents'; } - return IPA.sudorule_association_adder_dialog({ + return IPA.sudo.rule_association_adder_dialog({ 'title': title, 'entity_name': that.entity_name, 'pkey': pkey, @@ -936,7 +938,7 @@ IPA.sudorule_association_table_widget = function (spec) { }; -IPA.sudorule_association_adder_dialog = function (spec) { +IPA.sudo.rule_association_adder_dialog = function (spec) { spec = spec || {}; -- cgit