diff options
author | Adam Young <ayoung@redhat.com> | 2010-11-12 20:51:15 -0500 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2010-11-14 01:53:52 -0500 |
commit | 59a0c17c54b2136946a43b012380f926d9d9e7f3 (patch) | |
tree | 0d290cbcc650a79c2f8f5b20da3d02bc94bc7e4c /install | |
parent | 828f87e4a6996c0509e7ea65fd6d090bc6ee90b8 (diff) | |
download | freeipa-59a0c17c54b2136946a43b012380f926d9d9e7f3.tar.gz freeipa-59a0c17c54b2136946a43b012380f926d9d9e7f3.tar.xz freeipa-59a0c17c54b2136946a43b012380f926d9d9e7f3.zip |
super to superior
Diffstat (limited to 'install')
-rw-r--r-- | install/static/add.js | 2 | ||||
-rw-r--r-- | install/static/associate.js | 8 | ||||
-rw-r--r-- | install/static/details.js | 2 | ||||
-rw-r--r-- | install/static/entity.js | 4 | ||||
-rw-r--r-- | install/static/group.js | 8 | ||||
-rwxr-xr-x | install/static/hbac.js | 50 | ||||
-rwxr-xr-x | install/static/hbacsvc.js | 26 | ||||
-rwxr-xr-x | install/static/hbacsvcgroup.js | 26 | ||||
-rw-r--r-- | install/static/search.js | 8 | ||||
-rw-r--r-- | install/static/service.js | 16 | ||||
-rw-r--r-- | install/static/test/entity_tests.js | 109 | ||||
-rwxr-xr-x | install/static/widget.js | 12 |
12 files changed, 81 insertions, 190 deletions
diff --git a/install/static/add.js b/install/static/add.js index 9c68aea31..6b31a6ede 100644 --- a/install/static/add.js +++ b/install/static/add.js @@ -94,7 +94,7 @@ function ipa_add_dialog(spec) { ipa_cmd('add', args, options, on_success, on_error, that.entity_name); }; - that.super_init = that.super('init'); + that.superior_init = that.superior('init'); return that; } diff --git a/install/static/associate.js b/install/static/associate.js index ef3a72c1e..eda85dc8c 100644 --- a/install/static/associate.js +++ b/install/static/associate.js @@ -243,8 +243,8 @@ function ipa_association_widget(spec) { that.other_entity = spec.other_entity; - that.super_create = that.super('create'); - that.super_setup = that.super('setup'); + that.superior_create = that.superior('create'); + that.superior_setup = that.superior('setup'); that.create = function(container) { @@ -256,7 +256,7 @@ function ipa_association_widget(spec) { 'primary_key': true }); - that.super_create(container); + that.superior_create(container); var div = $('#'+that.id, container); var buttons = $('span[name=buttons]', div); @@ -276,7 +276,7 @@ function ipa_association_widget(spec) { that.setup = function(container) { - that.super_setup(container); + that.superior_setup(container); var entity = IPA.get_entity(that.entity_name); var association = entity.get_association(that.other_entity); diff --git a/install/static/details.js b/install/static/details.js index 4a024e986..612716c35 100644 --- a/install/static/details.js +++ b/install/static/details.js @@ -168,7 +168,7 @@ function ipa_details_section(spec){ that.fields = []; that.fields_by_name = {}; - that.super = function(name) { + that.superior = function(name) { var method = that[name]; return function () { return method.apply(that, arguments); diff --git a/install/static/entity.js b/install/static/entity.js index 94eab45b6..3eafedc0a 100644 --- a/install/static/entity.js +++ b/install/static/entity.js @@ -45,7 +45,7 @@ function ipa_facet(spec) { that.setup_views = ipa_facet_setup_views; - that.super = function(name) { + that.superior = function(name) { var method = that[name]; return function () { return method.apply(that, arguments); @@ -88,7 +88,7 @@ function ipa_entity(spec) { that.associations = []; that.associations_by_name = {}; - that.super = function(name) { + that.superior = function(name) { var method = that[name]; return function () { return method.apply(that, arguments); diff --git a/install/static/group.js b/install/static/group.js index 45aa83a58..2358cf1fb 100644 --- a/install/static/group.js +++ b/install/static/group.js @@ -26,7 +26,7 @@ function ipa_group() { 'name': 'group' }); - that.super_init = that.super('init'); + that.superior_init = that.superior('init'); that.init = function() { @@ -37,7 +37,7 @@ function ipa_group() { that.add_dialog(dialog); dialog.init(); - that.super_init(); + that.superior_init(); }; return that; @@ -51,11 +51,11 @@ function ipa_group_add_dialog(spec) { var that = ipa_add_dialog(spec); - that.super_init = that.super('init'); + that.superior_init = that.superior('init'); that.init = function() { - this.super_init(); + this.superior_init(); this.add_field(ipa_text_widget({name:'cn', label:'Name'})); this.add_field(ipa_text_widget({name:'description', label:'Description'})); diff --git a/install/static/hbac.js b/install/static/hbac.js index a5b7676c1..be0e73ad5 100755 --- a/install/static/hbac.js +++ b/install/static/hbac.js @@ -26,7 +26,7 @@ function ipa_hbac() { 'name': 'hbac' }); - that.super_init = that.super('init'); + that.superior_init = that.superior('init'); that.init = function() { @@ -49,7 +49,7 @@ function ipa_hbac() { }); that.add_facet(facet); - that.super_init(); + that.superior_init(); }; return that; @@ -63,11 +63,11 @@ function ipa_hbac_add_dialog(spec) { var that = ipa_add_dialog(spec); - that.super_init = that.super('init'); + that.superior_init = that.superior('init'); that.init = function() { - that.super_init(); + that.superior_init(); that.add_field(ipa_text_widget({ 'name': 'cn', @@ -89,9 +89,9 @@ function ipa_hbac_search_facet(spec) { var that = ipa_search_facet(spec); - that.super_init = that.super('init'); - that.super_create = that.super('create'); - that.super_setup = that.super('setup'); + that.superior_init = that.superior('init'); + that.superior_create = that.superior('create'); + that.superior_setup = that.superior('setup'); that.init = function() { @@ -108,7 +108,7 @@ function ipa_hbac_search_facet(spec) { setup: ipa_hbac_quick_links }); - that.super_init(); + that.superior_init(); }; that.create = function(container) { @@ -159,7 +159,7 @@ function ipa_hbac_search_facet(spec) { container.append('<br/><br/>'); - that.super_create(container); + that.superior_create(container); }; return that; @@ -210,9 +210,9 @@ function ipa_hbac_details_facet(spec) { var that = ipa_details_facet(spec); - that.super_init = that.super('init'); - that.super_create = that.super('create'); - that.super_setup = that.super('setup'); + that.superior_init = that.superior('init'); + that.superior_create = that.superior('create'); + that.superior_setup = that.superior('setup'); that.init = function() { @@ -415,7 +415,7 @@ function ipa_hbac_details_facet(spec) { 'name': 'accesstime', 'label': 'Access Time' })); - that.super_init(); + that.superior_init(); }; return that; @@ -533,7 +533,7 @@ function ipa_hbac_details_tables_section(spec){ that.tables = spec.tables; that.columns = spec.columns; - that.super_setup = that.super('setup'); + that.superior_setup = that.superior('setup'); that.create = function(container) { @@ -584,9 +584,9 @@ function ipa_hbac_association_widget(spec) { that.add_method = spec.add_method; that.delete_method = spec.delete_method; - that.super_init = that.super('init'); - that.super_create = that.super('create'); - that.super_setup = that.super('setup'); + that.superior_init = that.superior('init'); + that.superior_create = that.superior('create'); + that.superior_setup = that.superior('setup'); that.init = function() { // create a column if none defined @@ -598,12 +598,12 @@ function ipa_hbac_association_widget(spec) { }); } - that.super_init(); + that.superior_init(); }; that.create = function(container) { - that.super_create(container); + that.superior_create(container); var div = $('#'+that.id, container); @@ -624,7 +624,7 @@ function ipa_hbac_association_widget(spec) { that.setup = function(container) { - that.super_setup(container); + that.superior_setup(container); var entity = IPA.get_entity(that.entity_name); var association = entity.get_association(that.other_entity); @@ -744,9 +744,9 @@ function ipa_hbac_accesstime_widget(spec) { var that = ipa_table_widget(spec); - that.super_init = that.super('init'); - that.super_create = that.super('create'); - that.super_setup = that.super('setup'); + that.superior_init = that.superior('init'); + that.superior_create = that.superior('create'); + that.superior_setup = that.superior('setup'); that.init = function() { // create a column if none defined @@ -758,12 +758,12 @@ function ipa_hbac_accesstime_widget(spec) { }); } - that.super_init(); + that.superior_init(); }; that.create = function(container) { - that.super_create(container); + that.superior_create(container); var div = $('#'+that.id); diff --git a/install/static/hbacsvc.js b/install/static/hbacsvc.js index 0d704a0af..1c7952349 100755 --- a/install/static/hbacsvc.js +++ b/install/static/hbacsvc.js @@ -26,7 +26,7 @@ function ipa_hbacsvc() { 'name': 'hbacsvc' }); - that.super_init = that.super('init'); + that.superior_init = that.superior('init'); that.init = function() { @@ -49,7 +49,7 @@ function ipa_hbacsvc() { }); that.add_facet(facet); - that.super_init(); + that.superior_init(); }; return that; @@ -63,11 +63,11 @@ function ipa_hbacsvc_add_dialog(spec) { var that = ipa_add_dialog(spec); - that.super_init = that.super('init'); + that.superior_init = that.superior('init'); that.init = function() { - this.super_init(); + this.superior_init(); this.add_field(ipa_text_widget({name:'cn', label:'Name'})); this.add_field(ipa_text_widget({name:'description', label:'Description'})); @@ -82,9 +82,9 @@ function ipa_hbacsvc_search_facet(spec) { var that = ipa_search_facet(spec); - that.super_init = that.super('init'); - that.super_create = that.super('create'); - that.super_setup = that.super('setup'); + that.superior_init = that.superior('init'); + that.superior_create = that.superior('create'); + that.superior_setup = that.superior('setup'); that.init = function() { @@ -97,7 +97,7 @@ function ipa_hbacsvc_search_facet(spec) { setup: ipa_hbacsvc_quick_links }); - that.super_init(); + that.superior_init(); }; that.create = function(container) { @@ -133,7 +133,7 @@ function ipa_hbacsvc_search_facet(spec) { container.append('<br/><br/>'); - that.super_create(container); + that.superior_create(container); }; return that; @@ -170,9 +170,9 @@ function ipa_hbacsvc_details_facet(spec) { var that = ipa_details_facet(spec); - that.super_init = that.super('init'); - that.super_create = that.super('create'); - that.super_setup = that.super('setup'); + that.superior_init = that.superior('init'); + that.superior_create = that.superior('create'); + that.superior_setup = that.superior('setup'); that.init = function() { @@ -184,7 +184,7 @@ function ipa_hbacsvc_details_facet(spec) { section.create_field({ 'name': 'cn', 'label': 'Name' }); section.create_field({ 'name': 'description', 'label': 'Description' }); - that.super_init(); + that.superior_init(); }; return that; diff --git a/install/static/hbacsvcgroup.js b/install/static/hbacsvcgroup.js index f57a3bae9..eef6d6969 100755 --- a/install/static/hbacsvcgroup.js +++ b/install/static/hbacsvcgroup.js @@ -26,7 +26,7 @@ function ipa_hbacsvcgroup() { 'name': 'hbacsvcgroup' }); - that.super_init = that.super('init'); + that.superior_init = that.superior('init'); that.init = function() { @@ -60,7 +60,7 @@ function ipa_hbacsvcgroup() { }); that.add_facet(facet); - that.super_init(); + that.superior_init(); }; return that; @@ -74,11 +74,11 @@ function ipa_hbacsvcgroup_add_dialog(spec) { var that = ipa_add_dialog(spec); - that.super_init = that.super('init'); + that.superior_init = that.superior('init'); that.init = function() { - this.super_init(); + this.superior_init(); this.add_field(ipa_text_widget({name:'cn', label:'Name'})); this.add_field(ipa_text_widget({name:'description', label:'Description'})); @@ -93,9 +93,9 @@ function ipa_hbacsvcgroup_search_facet(spec) { var that = ipa_search_facet(spec); - that.super_init = that.super('init'); - that.super_create = that.super('create'); - that.super_setup = that.super('setup'); + that.superior_init = that.superior('init'); + that.superior_create = that.superior('create'); + that.superior_setup = that.superior('setup'); that.init = function() { @@ -108,7 +108,7 @@ function ipa_hbacsvcgroup_search_facet(spec) { setup: ipa_hbacsvcgroup_quick_links }); - that.super_init(); + that.superior_init(); }; that.create = function(container) { @@ -144,7 +144,7 @@ function ipa_hbacsvcgroup_search_facet(spec) { container.append('<br/><br/>'); - that.super_create(container); + that.superior_create(container); }; return that; @@ -181,9 +181,9 @@ function ipa_hbacsvcgroup_details_facet(spec) { var that = ipa_details_facet(spec); - that.super_init = that.super('init'); - that.super_create = that.super('create'); - that.super_setup = that.super('setup'); + that.superior_init = that.superior('init'); + that.superior_create = that.superior('create'); + that.superior_setup = that.superior('setup'); that.init = function() { @@ -195,7 +195,7 @@ function ipa_hbacsvcgroup_details_facet(spec) { section.create_field({ 'name': 'cn', 'label': 'Name' }); section.create_field({ 'name': 'description', 'label': 'Description' }); - that.super_init(); + that.superior_init(); }; return that; diff --git a/install/static/search.js b/install/static/search.js index f5d81587b..e253f78c4 100644 --- a/install/static/search.js +++ b/install/static/search.js @@ -28,8 +28,8 @@ function ipa_search_widget(spec) { var that = ipa_table_widget(spec); - that.super_create = that.super('create'); - that.super_setup = that.super('setup'); + that.superior_create = that.superior('create'); + that.superior_setup = that.superior('setup'); that.create = function(container) { @@ -71,12 +71,12 @@ function ipa_search_widget(spec) { 'class': 'search-results' }).appendTo(div); - that.super_create(container); + that.superior_create(container); }; that.setup = function(container) { - that.super_setup(container); + that.superior_setup(container); var filter = $.bbq.getState(that.entity_name + '-filter', true) || ''; this.filter.val(filter); diff --git a/install/static/service.js b/install/static/service.js index 4d1c94b96..86545cc0f 100644 --- a/install/static/service.js +++ b/install/static/service.js @@ -26,7 +26,7 @@ function ipa_service() { 'name': 'service' }); - that.super_init = that.super('init'); + that.superior_init = that.superior('init'); that.init = function() { @@ -60,7 +60,7 @@ function ipa_service() { }); that.add_facet(facet); - that.super_init(); + that.superior_init(); }; return that; @@ -74,11 +74,11 @@ function ipa_service_add_dialog(spec) { var that = ipa_add_dialog(spec); - that.super_init = that.super('init'); + that.superior_init = that.superior('init'); that.init = function() { - this.super_init(); + this.superior_init(); this.add_field(ipa_widget({ name: 'krbprincipalname', @@ -155,12 +155,12 @@ function ipa_service_search_facet(spec) { var that = ipa_search_facet(spec); - that.super_init = that.super('init'); + that.superior_init = that.superior('init'); that.init = function() { this.create_column({name:'krbprincipalname', label:'Principal'}); - that.super_init(); + that.superior_init(); }; return that; @@ -172,7 +172,7 @@ function ipa_service_details_facet(spec) { var that = ipa_details_facet(spec); - that.super_init = that.super('init'); + that.superior_init = that.superior('init'); that.init = function() { @@ -211,7 +211,7 @@ function ipa_service_details_facet(spec) { load: service_usercertificate_load }); - that.super_init(); + that.superior_init(); }; return that; diff --git a/install/static/test/entity_tests.js b/install/static/test/entity_tests.js index 5b2f36b2b..970f9a89b 100644 --- a/install/static/test/entity_tests.js +++ b/install/static/test/entity_tests.js @@ -132,112 +132,3 @@ test('Testing ipa_facet_setup_views().', function() { IPA.show_page = orig_show_page; }); -test('Testing ipa_entity_quick_links().', function() { - - var orig_push_state = nav_push_state; - var orig_get_state = nav_get_state; - var orig_remove_state = nav_remove_state; - - var state = {}; - - nav_push_state = function(params) { - $.extend(state, params); - }; - nav_get_state = function(key) { - return state[key]; - }; - nav_remove_state = function(key) { - delete state[key]; - }; - - IPA.ajax_options.async = false; - - IPA.init( - 'data', - true, - function(data, text_status, xhr) { - ok(true, 'ipa_init() succeeded.'); - }, - function(xhr, text_status, error_thrown) { - ok(false, 'ipa_init() failed: '+error_thrown); - } - ); - - var obj_name = 'user'; - var pkey = IPA.metadata[obj_name].primary_key; - var pkey_value = 'test'; - - var entry_attrs = {}; - entry_attrs[pkey] = [pkey_value]; - - var container = $('<div/>', { - title: obj_name, - class: 'entity-container' - }); - - var search_table = $('<table/>', { - class: 'search-table' - }).appendTo(container); - - var tbody = $('<tbody/>').appendTo(search_table); - var tr = $('<tr/>').appendTo(tbody); - var td = $('<td/>').appendTo(tr); - var span = $('<span/>', {name:'quick_links'}).appendTo(td); - - ipa_entity_quick_links(tr, 'quick_links', null, entry_attrs); - - var link = span.children().first(); - - equals( - link.attr('href'), '#details', - 'Checking details link' - ); - - link.click(); - - equals( - state[obj_name+'-facet'], 'details', - 'Checking state[\''+obj_name+'-facet\']' - ); - - equals( - state[obj_name+'-pkey'], pkey_value, - 'Checking state[\''+obj_name+'-pkey\']' - ); - - var attribute_members = IPA.metadata[obj_name].attribute_members; - for (attr_name in attribute_members) { - var objs = attribute_members[attr_name]; - for (var i = 0; i < objs.length; ++i) { - var m = objs[i]; - - link = link.next(); - - equals( - link.attr('href'), '#'+m, - 'Checking '+m+' link' - ); - - link.click(); - - equals( - state[obj_name+'-facet'], 'associate', - 'Checking state[\''+obj_name+'-facet\']' - ); - - equals( - state[obj_name+'-enroll'], m, - 'Checking state[\''+obj_name+'-enroll\']' - ); - - equals( - state[obj_name+'-pkey'], pkey_value, - 'Checking state[\''+obj_name+'-pkey\']' - ); - } - } - - nav_push_state = orig_push_state; - nav_get_state = orig_get_state; - nav_remove_state = orig_remove_state; -}); diff --git a/install/static/widget.js b/install/static/widget.js index 281370caa..741195504 100755 --- a/install/static/widget.js +++ b/install/static/widget.js @@ -39,7 +39,7 @@ function ipa_widget(spec) { that.save = spec.save || save; that.clear = spec.clear || clear; - that.super = function(name) { + that.superior = function(name) { var method = that[name]; return function () { return method.apply(that, arguments); @@ -570,7 +570,7 @@ function ipa_dialog(spec) { that.fields = []; that.fields_by_name = {}; - that.super = function(name) { + that.superior = function(name) { var method = that[name]; return function () { return method.apply(that, arguments); @@ -696,7 +696,7 @@ function ipa_adder_dialog(spec) { that.width = spec.width || 600; - that.super_open = that.super('open'); + that.superior_open = that.superior('open'); that.create = function() { @@ -785,7 +785,7 @@ function ipa_adder_dialog(spec) { 'Cancel': that.close }; - that.super_open(container); + that.superior_open(container); }; that.get_filter = function() { @@ -841,7 +841,7 @@ function ipa_deleter_dialog(spec) { that.title = spec.title || IPA.messages.button.remove; that.remove = spec.remove; - that.super_open = that.super('open'); + that.superior_open = that.superior('open'); that.values = spec.values || []; @@ -874,7 +874,7 @@ function ipa_deleter_dialog(spec) { 'Cancel': that.close }; - that.super_open(container); + that.superior_open(container); }; return that; |